X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7dda1ffa3db91707f2a554fc3c8dffa34e0e510..bd996abe63a8ed6aa07b26856a0d7935002e3e81:/src/gtk1/popupwin.cpp diff --git a/src/gtk1/popupwin.cpp b/src/gtk1/popupwin.cpp index 7f63baa20f..923a68bbd1 100644 --- a/src/gtk1/popupwin.cpp +++ b/src/gtk1/popupwin.cpp @@ -149,6 +149,12 @@ 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; @@ -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; }