From c51c4752023d10f398e5480bf3e22e32ba68edac Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 7 Feb 2005 22:37:24 +0000 Subject: [PATCH] Added screen locking code to popup window for X11. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/popupcmn.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 8dc2f18ebb..79b3bbf23b 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -46,6 +46,9 @@ #ifdef __WXGTK__ #include #endif +#ifdef __WXX11__ +#include "wx/x11/private.h" +#endif IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxPopupTransientWindow, wxPopupWindow) @@ -284,6 +287,13 @@ bool wxPopupTransientWindow::Show( bool show ) } #endif +#ifdef __WXX11__ + if (!show) + { + XUngrabPointer( wxGlobalDisplay(), CurrentTime ); + } +#endif + bool ret = wxPopupWindow::Show( show ); #ifdef __WXGTK__ @@ -303,6 +313,21 @@ bool wxPopupTransientWindow::Show( bool show ) } #endif +#ifdef __WXX11__ + if (show) + { + Window xwindow = (Window) m_clientWindow; + + /* int res =*/ XGrabPointer(wxGlobalDisplay(), xwindow, + True, + ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, + GrabModeAsync, + GrabModeAsync, + None, + None, + CurrentTime ); + } +#endif return ret; }