From d482590c84f43dbffdec71722d248edc8a357ff6 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Sat, 9 Feb 2013 11:29:07 +0100 Subject: [PATCH] Fix button check in meta_window_client_message Fixes a regression introduced in 3a3be74e37048a33fb29b355aff99a5cc7f75419 https://bugzilla.gnome.org/show_bug.cgi?id=692718 --- src/core/window.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 9a2944d0c..1a4c68073 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6321,6 +6321,9 @@ meta_window_change_workspace_by_index (MetaWindow *window, #define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 #define _NET_WM_MOVERESIZE_CANCEL 11 +/* Copied from the old gtk+/xi2 branch */ +#define XIMaskIsSet(ptr, bit) (((unsigned char *) (ptr))[(bit) >> 3] & (1 << ((bit) & 7))) + gboolean meta_window_client_message (MetaWindow *window, XEvent *event) @@ -6703,11 +6706,11 @@ meta_window_client_message (MetaWindow *window, &buttons, &mods, &group); meta_error_trap_pop (window->display); - if (mods.effective & Button1Mask) + if (XIMaskIsSet (buttons.mask, Button1)) button = 1; - else if (mods.effective & Button2Mask) + else if (XIMaskIsSet (buttons.mask, Button2)) button = 2; - else if (mods.effective & Button3Mask) + else if (XIMaskIsSet (buttons.mask, Button3)) button = 3; else button = 0;