[Xfce4-commits] [xfce/xfwm4] 01/02: placement: Use primary monitor as default
noreply at xfce.org
noreply at xfce.org
Mon May 15 09:10:16 CEST 2017
This is an automated email from the git hooks/post-receive script.
olivier pushed a commit to branch xfce-4.12
in repository xfce/xfwm4.
commit e9d1de4c9bf4512760a512ecab7411ac08165f2a
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Thu Mar 23 11:39:04 2017 +0100
placement: Use primary monitor as default
Bug: 13454
We would use the first monitor by default, but we'd rather use the
primary monitor.
Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
(cherry picked from commit dee7e7e5019b14f0f76eb8be962ffa9502e346e4)
---
src/placement.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/placement.c b/src/placement.c
index e9a32c7..9090a3f 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -487,7 +487,7 @@ clientKeepVisible (Client * c, gint n_monitors, GdkRectangle *monitor_rect)
{
if ((c->size->x == 0) && (c->size->y == 0))
{
- /* Dialogs that place temselves in (0,0) will be centered */
+ /* Dialogs that place themselves in (0,0) will be centered */
centered = TRUE;
}
else if ((n_monitors > 1) && (c->size->x > 0) && (c->size->y > 0))
@@ -771,7 +771,9 @@ clientInitPosition (Client * c)
position = (c->size->flags & (PPosition | USPosition));
n_monitors = myScreenGetNumMonitors (c->screen_info);
- gdk_screen_get_monitor_geometry (screen_info->gscr, 0, &rect);
+ gdk_screen_get_monitor_geometry (screen_info->gscr,
+ gdk_screen_get_primary_monitor (screen_info->gscr),
+ &rect);
is_transient = clientIsTransient (c);
if (position || is_transient || (c->type & (WINDOW_TYPE_DONT_PLACE | WINDOW_TYPE_DIALOG)))
@@ -783,7 +785,7 @@ clientInitPosition (Client * c)
c->y = c2->y + (c2->height - c->height) / 2;
}
- if (n_monitors > 1)
+ if (position && n_monitors > 1)
{
msx = frameExtentX (c) + (frameExtentWidth (c) / 2);
msy = frameExtentY (c) + (frameExtentHeight (c) / 2);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list