X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7dda1ffa3db91707f2a554fc3c8dffa34e0e510..c91a2f7e67fae4278e2f931209aa386b5d67ae9d:/src/gtk/popupwin.cpp diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 7f63baa20f..236a69d036 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/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; }