From 0848613041444d3d40c9cc811e09f9b6239c9524 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 27 May 2016 10:38:45 +0200 Subject: [PATCH] placement: Don't relocate on monitor if position is specificed Bug: 12587 If the client (or user) has specified a position for a window, do not relocate it on the active monitor, use the entire screen for placement instead. Signed-off-by: Olivier Fourdan --- src/placement.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/placement.c b/src/placement.c index 7b0ca22..6e09139 100644 --- a/src/placement.c +++ b/src/placement.c @@ -779,8 +779,17 @@ clientInitPosition (Client * c) position = (c->size->flags & (PPosition | USPosition)); n_monitors = myScreenGetNumMonitors (c->screen_info); - if ((n_monitors > 1) || (screen_info->params->placement_mode == PLACE_MOUSE)) + if (position) { + /* If a position was specified by the client, use the entire screen */ + rect.x = 0; + rect.y = 0; + rect.width = screen_info->width; + rect.height = screen_info->height; + } + else if ((n_monitors > 1) || (screen_info->params->placement_mode == PLACE_MOUSE)) + { + /* Otherwise use the monitor where the mouse pointer resides */ getMouseXY (screen_info, screen_info->xroot, &msx, &msy); myScreenFindMonitorAtPoint (screen_info, msx, msy, &rect); } -- 2.7.4