[mutter] Fix button check in meta_window_client_message



commit d482590c84f43dbffdec71722d248edc8a357ff6
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Sat Feb 9 11:29:07 2013 +0100

    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 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 9a2944d..1a4c680 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]