X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e74c05294a531442eb2d8ce37dd5fcf243814523..ab86c659ac3093dc5513ff0c5001d2fa2979b30c:/src/gtk1/toplevel.cpp diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 65ab67c6bb..96e0da6119 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -883,21 +883,6 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title ) gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) ); } -void wxTopLevelWindowGTK::DoSetIcon( const wxIcon &icon ) -{ - if ( !icon.Ok() ) - return; - - if (!m_widget->window) - return; - - wxMask *mask = icon.GetMask(); - GdkBitmap *bm = (GdkBitmap *) NULL; - if (mask) bm = mask->GetBitmap(); - - gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm ); -} - void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon ) { SetIcons( wxIconBundle( icon ) ); @@ -906,16 +891,41 @@ void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon ) void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - GdkWindow* window = m_widget->window; wxTopLevelWindowBase::SetIcons( icons ); - DoSetIcon( icons.GetIcon( -1 ) ); - if ( window ) +#ifdef __WXGTK20__ + GList *list = NULL; + size_t max = icons.m_icons.GetCount(); + + for (size_t i = 0; i < max; i++) + { + if (icons.m_icons[i].Ok()) + { + list = g_list_prepend(list, icons.m_icons[i].GetPixbuf()); + } + } + gtk_window_set_icon_list(GTK_WINDOW(m_widget), list); + g_list_free(list); + +#else // !__WXGTK20__ + GdkWindow* window = m_widget->window; + if (!window) + return; + + wxIcon icon = icons.GetIcon(-1); + if (icon.Ok()) { - wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ), - (WXWindow)GDK_WINDOW_XWINDOW( window ), icons ); + wxMask *mask = icon.GetMask(); + GdkBitmap *bm = (GdkBitmap *) NULL; + if (mask) bm = mask->GetBitmap(); + + gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm ); } + + wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ), + (WXWindow)GDK_WINDOW_XWINDOW( window ), icons ); +#endif // !__WXGTK20__ } // ---------------------------------------------------------------------------- @@ -936,15 +946,22 @@ 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() { -#ifdef __GTK20__ +#ifdef __WXGTK20__ // "Present" seems similar enough to "restore" gtk_window_present( GTK_WINDOW( m_widget ) ); #else