From: Pierre Ossman Date: Thu, 17 Nov 2011 10:19:19 +0000 (+0000) Subject: Also grab the mouse pointer in full screen as some window managers like to X-Git-Tag: v1.1.90~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53fd544c2f68b2ff97fb3f5e60734b281ce75ad3;p=tigervnc.git Also grab the mouse pointer in full screen as some window managers like to 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 --- diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index abd38c92..41abf6be 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -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 }