summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-07-24 15:41:44 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-07-24 15:41:44 +0000
commit78a2866980bee5a1a472cbb8e7cbe75dc3da7f86 (patch)
tree383da2a91de5a2f3aa2bb03fa8551be7715ed922 /src/window.c
parent6f6e5333800f7be0e6854ff0e1f63eed2f14cd83 (diff)
downloadmetacity-78a2866980bee5a1a472cbb8e7cbe75dc3da7f86.tar.gz
metacity-78a2866980bee5a1a472cbb8e7cbe75dc3da7f86.tar.bz2
grab display across managing each screen; XGetInputFocus() on startup.
2002-07-20 Havoc Pennington <hp@pobox.com> * src/display.c (meta_display_open): grab display across managing each screen; XGetInputFocus() on startup. 2002-07-19 Havoc Pennington <hp@pobox.com> * src/window.c (meta_window_configure_request): disable configure requests during a user move/resize operation, mostly a workaround for stoopid apps.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index 882f977..54e989f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2944,6 +2944,37 @@ meta_window_configure_request (MetaWindow *window,
int x, y, width, height;
gboolean only_resize;
gboolean allow_position_change;
+ gboolean in_grab_op;
+
+ /* We ignore configure requests while the user is moving/resizing
+ * the window, since these represent the app sucking and fighting
+ * the user, most likely due to a bug in the app (e.g. pfaedit
+ * seemed to do this)
+ *
+ * Still have to do the ConfigureNotify and all, but pretend the
+ * app asked for the current size/position instead of the new one.
+ */
+ in_grab_op = FALSE;
+ if (window->display->grab_op != META_GRAB_OP_NONE &&
+ window == window->display->grab_window)
+ {
+ switch (window->display->grab_op)
+ {
+ case META_GRAB_OP_MOVING:
+ case META_GRAB_OP_RESIZING_SE:
+ case META_GRAB_OP_RESIZING_S:
+ case META_GRAB_OP_RESIZING_SW:
+ case META_GRAB_OP_RESIZING_N:
+ case META_GRAB_OP_RESIZING_NE:
+ case META_GRAB_OP_RESIZING_NW:
+ case META_GRAB_OP_RESIZING_W:
+ case META_GRAB_OP_RESIZING_E:
+ in_grab_op = TRUE;
+ break;
+ default:
+ break;
+ }
+ }
/* it's essential to use only the explicitly-set fields,
* and otherwise use our current up-to-date position.
@@ -2978,6 +3009,9 @@ meta_window_configure_request (MetaWindow *window,
{
allow_position_change = TRUE;
}
+
+ if (in_grab_op)
+ allow_position_change = FALSE;
if (allow_position_change)
{
@@ -3009,11 +3043,14 @@ meta_window_configure_request (MetaWindow *window,
width = window->rect.width;
height = window->rect.height;
- if (event->xconfigurerequest.value_mask & CWWidth)
- width = event->xconfigurerequest.width;
+ if (!in_grab_op)
+ {
+ if (event->xconfigurerequest.value_mask & CWWidth)
+ width = event->xconfigurerequest.width;
- if (event->xconfigurerequest.value_mask & CWHeight)
- height = event->xconfigurerequest.height;
+ if (event->xconfigurerequest.value_mask & CWHeight)
+ height = event->xconfigurerequest.height;
+ }
/* ICCCM 4.1.5 */