X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7dda1ffa3db91707f2a554fc3c8dffa34e0e510..f68c6b523c1117c90c1cf690745c807bc024789d:/src/gtk1/popupwin.cpp diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index 7f63baa20f..236a69d036 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -149,12 +149,18 @@ END_EVENT_TABLE() IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow) +wxPopupWindow::~wxPopupWindow() +{ + if (GTK_WIDGET_HAS_GRAB(m_widget)) + gtk_grab_remove( m_widget ); +} + bool wxPopupWindow::Create( wxWindow *parent, int style ) { m_needParent = FALSE; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, "popup" )) + !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("popup") )) { wxFAIL_MSG( wxT("wxPopupWindow creation failed") ); return FALSE; @@ -342,9 +348,15 @@ bool wxPopupWindow::Show( bool show ) GtkOnSize( m_x, m_y, m_width, m_height ); } - + + if (!show) + gtk_grab_remove( m_widget ); + bool ret = wxWindow::Show( show ); - + + if (show) + gtk_grab_add( m_widget ); + return ret; }