From 80965058443eec71213d5d10cd7ab3a712db4c5d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 9 Jan 2013 10:11:55 +0000 Subject: [PATCH] geometry_auto_move option (enabled by default) now also corrects applications which fail in their attempts to center windows on multimonitor systems SVN revision: 82448 --- ChangeLog | 4 ++++ NEWS | 1 + src/bin/e_border.c | 19 ++++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3170d1aa0..fa37bf9d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-01-09 Mike Blumenkrantz + + * geometry_auto_move option now also corrects applications which fail in their attempts to center windows + 2013-01-08 David H. Bronke * Added new config option for disabling pointer warping when performing directional focus changes using winlist diff --git a/NEWS b/NEWS index 810957757..c1fdc423c 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ Improvements: * Added elm win trap callback for base size setting, calling this causes ICCCM hints to be applied * "System Default" language in wizard now displays which language it is and no longer removes language from list * Desktop->Shelves menu now shows shelf names + * geometry_auto_move option now also corrects applications which fail in their attempts to center windows Fixes: * Force check changed upon confirmation dialog closure for engine settings. diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 3cd7725e0..dff887895 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -8550,10 +8550,27 @@ _e_border_eval(E_Border *bd) if (bd->y + bd->h > zy + zh) bd->y = zy + zh - bd->h; - // <-- + // <-- if (bd->zone && e_container_zone_at_point_get(bd->zone->container, bd->x, bd->y)) { + if (!E_INSIDE(bd->x, bd->y, bd->zone->x, bd->zone->y, bd->zone->w, bd->zone->h)) + { + bd->x = E_CLAMP(bd->x, bd->zone->x, bd->zone->x + bd->zone->w); + bd->y = E_CLAMP(bd->y, bd->zone->y, bd->zone->y + bd->zone->h); + } + /* some application failing to correctly center a window */ + if (eina_list_count(bd->zone->container->zones) > 1) + { + if (((abs((bd->zone->container->w / 2) - bd->x) < 3) || //bd->x is center of container + ((abs((bd->zone->container->w / 2) - bd->x - bd->w) < 3) || //bd->x - bd->w is center of container + (abs((bd->zone->container->w / 2) - bd->x - (bd->w / 2)) < 3))) || //bd->x - bd->w/2 is center of container + ((abs((bd->zone->container->h / 2) - bd->y) < 3) || //bd->y is center of container + ((abs((bd->zone->container->h / 2) - bd->y - bd->h) < 3) || //bd->y - bd->h is center of container + (abs((bd->zone->container->h / 2) - bd->y - (bd->h / 2)) < 3))) //bd->y - bd->h/2 is center of container + ) + e_border_center(bd); + } bd->changes.pos = 1; bd->placed = 1; }