X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d26cb76b58d53bdd667e706f12442c349ff13bc1..cc3977bf132d40cb66c6b488890ef67a396d4a0a:/src/gtk/toplevel.cpp?ds=sidebyside diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 5a77576b0a..18d5775a2f 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -339,7 +339,6 @@ gtk_frame_map_callback( GtkWidget*, wxTopLevelWindow *win ) { const bool wasIconized = win->IsIconized(); - win->SetIconizeState(false); if (wasIconized) { // Because GetClientSize() returns (0,0) when IsIconized() is true, @@ -372,18 +371,18 @@ gtk_frame_map_callback( GtkWidget*, } //----------------------------------------------------------------------------- -// "unmap_event" from m_widget +// "window-state-event" from m_widget //----------------------------------------------------------------------------- extern "C" { static gboolean -gtk_frame_unmap_callback( GtkWidget * WXUNUSED(widget), - GdkEvent * WXUNUSED(event), +gtk_frame_window_state_callback( GtkWidget* WXUNUSED(widget), + GdkEventWindowState *event, wxTopLevelWindow *win ) { - // hiding the window doesn't count as minimizing it - if (win->IsShown()) - win->SetIconizeState(true); + if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) + win->SetIconizeState((event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) != 0); + return false; } } @@ -594,11 +593,14 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, g_signal_connect (m_widget, "realize", G_CALLBACK (gtk_frame_realized_callback), this); - // map and unmap for iconized state + // for some reported size corrections g_signal_connect (m_widget, "map_event", G_CALLBACK (gtk_frame_map_callback), this); - g_signal_connect (m_widget, "unmap_event", - G_CALLBACK (gtk_frame_unmap_callback), this); + + // for iconized state + g_signal_connect (m_widget, "window_state_event", + G_CALLBACK (gtk_frame_window_state_callback), this); + // for wxMoveEvent g_signal_connect (m_widget, "configure_event",