]> source.dussan.org Git - tigervnc.git/commitdiff
Also grab the mouse pointer in full screen as some window managers like to
authorPierre Ossman <ossman@cendio.se>
Thu, 17 Nov 2011 10:19:19 +0000 (10:19 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 17 Nov 2011 10:19:19 +0000 (10:19 +0000)
do special things with buttons combined with modifiers. The user probably
wants to propagate these to the server though.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4808 3789f03b-4d11-0410-bbf8-ca57d06f2519

vncviewer/DesktopWindow.cxx

index abd38c92fd54e1d3a3faa67634423ef15796da12..41abf6be292235eb4796f12ffa3dc8d6b4d03f5f 100644 (file)
@@ -332,6 +332,16 @@ void DesktopWindow::grabKeyboard()
       vlog.error(_("Failure grabbing keyboard"));
     }
   }
+
+  // We also need to grab the pointer as some WMs like to grab buttons
+  // combined with modifies (e.g. Alt+Button0 in metacity).
+  ret = XGrabPointer(fl_display, fl_xid(this), True,
+                     ButtonPressMask|ButtonReleaseMask|
+                     ButtonMotionMask|PointerMotionMask,
+                     GrabModeAsync, GrabModeAsync,
+                     None, None, CurrentTime);
+  if (ret)
+    vlog.error(_("Failure grabbing mouse"));
 #endif
 }
 
@@ -349,6 +359,7 @@ void DesktopWindow::ungrabKeyboard()
   if (Fl::grab())
     return;
 
+  XUngrabPointer(fl_display, fl_event_time);
   XUngrabKeyboard(fl_display, fl_event_time);
 #endif
 }