From f4bb632cde9cc60fa89f173f0d33c5881794cc68 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 7 Feb 2005 21:48:06 +0000 Subject: [PATCH] Lock whole screen when popup is open under GTK+. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/popupcmn.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index c1961f1973..8dc2f18ebb 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -198,8 +198,7 @@ void wxPopupTransientWindow::PopHandlers() m_handlerPopup = NULL; } - if (m_child->HasCapture()) - m_child->ReleaseMouse(); + // m_child->ReleaseMouse(); m_child = NULL; } @@ -278,14 +277,30 @@ bool wxPopupTransientWindow::Show( bool show ) { #ifdef __WXGTK__ if (!show) + { + gdk_pointer_ungrab( (guint32)GDK_CURRENT_TIME ); + gtk_grab_remove( m_widget ); + } #endif bool ret = wxPopupWindow::Show( show ); #ifdef __WXGTK__ if (show) + { gtk_grab_add( m_widget ); + + gdk_pointer_grab( m_widget->window, TRUE, + (GdkEventMask) + (GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_HINT_MASK | + GDK_POINTER_MOTION_MASK), + (GdkWindow *) NULL, + (GdkCursor *) NULL, + (guint32)GDK_CURRENT_TIME ); + } #endif return ret;