diff --git a/docs/changes.txt b/docs/changes.txt index 771ea9f542..edae6b67be 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -234,6 +234,8 @@ wxGTK: in wxSystemSettings::GetMetric (Mart Raudsepp) - wxGTK uses GTK+ 2.x by default now, you have to pass --disable-gtk2 to configure if you want to use GTK+ 1.2 +- implemented wxTopLevel::IsMaximized() for GTK+2 and WMs that implement + freedesktop.org's wm-spec (Mart Raudsepp) wxMotif: diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 507e47463a..d2a5bdd6b1 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -936,10 +936,17 @@ void wxTopLevelWindowGTK::Maximize(bool maximize) bool wxTopLevelWindowGTK::IsMaximized() const { +#ifdef __WXGTK20__ + if(!m_widget->window) + return false; + + return gdk_window_get_state(m_widget->window) & GDK_WINDOW_STATE_MAXIMIZED; +#else // wxFAIL_MSG( _T("not implemented") ); // This is an approximation return FALSE; +#endif } void wxTopLevelWindowGTK::Restore() diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 507e47463a..d2a5bdd6b1 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -936,10 +936,17 @@ void wxTopLevelWindowGTK::Maximize(bool maximize) bool wxTopLevelWindowGTK::IsMaximized() const { +#ifdef __WXGTK20__ + if(!m_widget->window) + return false; + + return gdk_window_get_state(m_widget->window) & GDK_WINDOW_STATE_MAXIMIZED; +#else // wxFAIL_MSG( _T("not implemented") ); // This is an approximation return FALSE; +#endif } void wxTopLevelWindowGTK::Restore()