From 3d661f9bc7848b827f5be4ed04727ae0e3e824a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Mon, 24 Jul 2006 17:15:32 +0000 Subject: [PATCH] Grab Alt+Shift+Button1 as well to partially fix operation ordering issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-07-24 Björn Lindqvist * src/display.c (meta_display_grab_window_buttons): Grab Alt+Shift+Button1 as well to partially fix operation ordering issues when trying to snap-move windows. Part of #112478. --- ChangeLog | 6 ++++++ src/display.c | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8dc8929d..210622666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-24 Björn Lindqvist + + * display.c (meta_display_grab_window_buttons): Grab + Alt+Shift+Button1 as well to partially fix operation ordering + issues when trying to snap-move windows. Part of #112478. + 2006-07-21 Thomas Thurman * ui.[ch] (filter_func): Avoid a case where a struct's diff --git a/src/display.c b/src/display.c index cf02a9e20..f7a9bcc4e 100644 --- a/src/display.c +++ b/src/display.c @@ -3711,8 +3711,10 @@ void meta_display_grab_window_buttons (MetaDisplay *display, Window xwindow) { - /* Grab Alt + button1 and Alt + button2 for moving window, - * and Alt + button3 for popping up window menu. + /* Grab Alt + button1 for moving window. + * Grab Alt + button2 for resizing window. + * Grab Alt + button3 for popping up window menu. + * Grab Alt + Shift + button1 for snap-moving window. */ meta_verbose ("Grabbing window buttons for 0x%lx\n", xwindow); @@ -3724,11 +3726,10 @@ meta_display_grab_window_buttons (MetaDisplay *display, if (display->window_grab_modifiers != 0) { gboolean debug = g_getenv ("METACITY_DEBUG_BUTTON_GRABS") != NULL; - int i = 1; - while (i < 4) + int i; + for (i = 1; i < 4; i++) { - meta_change_button_grab (display, - xwindow, + meta_change_button_grab (display, xwindow, TRUE, FALSE, i, display->window_grab_modifiers); @@ -3741,9 +3742,18 @@ meta_display_grab_window_buttons (MetaDisplay *display, TRUE, FALSE, i, ControlMask); - - ++i; } + + /* In addition to grabbing Alt+Button1 for moving the window, + * grab Alt+Shift+Button1 for snap-moving the window. See bug + * 112478. Unfortunately, this doesn't work with + * Shift+Alt+Button1 for some reason; so at least part of the + * order still matters, which sucks (please FIXME). + */ + meta_change_button_grab (display, xwindow, + TRUE, + FALSE, + 1, display->window_grab_modifiers | ShiftMask); } }