[mutter/wip/gestures: 2/16] frame: Only select for ButtonPress/Release/Motion/Crossing



commit ae91de5d03594e162f94ee11e20f70a1fea8086f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 19 21:15:14 2014 +0200

    frame: Only select for ButtonPress/Release/Motion/Crossing
    
    Touch events are largely ignored on GdkEvent emulation, so only
    make frames receive pointer events, only the pointer emulating
    touch will be reported, and any other further touches will be
    ignored, which is about the behavior we want. This makes window
    dragging possible again on touch.

 src/core/frame.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index 0895241..f80148f 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -109,6 +109,19 @@ meta_window_ensure_frame (MetaWindow *window)
   XChangeWindowAttributes (window->display->xdisplay,
                           frame->xwindow, CWEventMask, &attrs);
 
+  {
+    unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
+    XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
+
+    XISetMask (mask.mask, XI_ButtonPress);
+    XISetMask (mask.mask, XI_ButtonRelease);
+    XISetMask (mask.mask, XI_Motion);
+    XISetMask (mask.mask, XI_Enter);
+    XISetMask (mask.mask, XI_Leave);
+
+    XISelectEvents (window->display->xdisplay, frame->xwindow, &mask, 1);
+  }
+
   meta_display_register_x_window (window->display, &frame->xwindow, window);
 
   meta_error_trap_push (window->display);


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