Implement support for grabbing the keyboard when in full screen mode.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4449 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index beee8ba..f522ca0 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -605,6 +605,13 @@
const Fl_Menu_Item *m;
char buffer[1024];
+ // FIXME: Hacky workaround for the fact that menus grab and ungrab the
+ // keyboard. Releasing focus here triggers some events on ungrab
+ // that DesktopWindow can catch and trigger some voodoo.
+ // See DesktopWindow::handle().
+ if (window()->contains(Fl::focus()))
+ Fl::focus(NULL);
+
contextMenu->position(Fl::event_x(), Fl::event_y());
m = contextMenu->popup();