Use window-state-event to send ICONIZE events under GTK+, probably fixes #10973: Iconize event triggered when switching workspaces with Ctrl+Alt+[Arrow Key]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2010-10-27 19:42:38 +00:00
parent 681be2ef80
commit f0f0542da6

View File

@ -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,19 +371,25 @@ 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);
return false;
if (event->changed_mask && GDK_WINDOW_STATE_ICONIFIED)
{
if (event->new_window_state && GDK_WINDOW_STATE_ICONIFIED)
win->SetIconizeState(true);
else
win->SetIconizeState(false);
}
return FALSE;
}
}
@ -594,11 +599,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",