]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/taskbarx11.cpp
hide MDI parent frame if it's empty and a new child has been created
[wxWidgets.git] / src / unix / taskbarx11.cpp
index 5b4704bc537a1d8b3cbdcd11d1aa62597a2223d2..b95729d16cac1a4e0a2b3d5cf481898e4d605ad4 100644 (file)
@@ -32,6 +32,7 @@
 #include "wx/sizer.h"
 #include "wx/dcclient.h"
 #include "wx/log.h"
+#include "wx/image.h"
 
 #ifdef __VMS
 #pragma message disable nosimpint
 // ----------------------------------------------------------------------------
 
 #ifdef __WXGTK20__
-    #include "wx/gtk/taskbarpriv.h"
-#else
+    #include <gtk/gtk.h>
+    #if GTK_CHECK_VERSION(2,1,0)
+        #include "wx/gtk/taskbarpriv.h"
+        #define TASKBAR_ICON_AREA_BASE_INCLUDED
+    #endif
+#endif
+
+#ifndef TASKBAR_ICON_AREA_BASE_INCLUDED
     class WXDLLIMPEXP_ADV wxTaskBarIconAreaBase : public wxFrame
     {
     public:
@@ -124,6 +131,10 @@ wxTaskBarIconArea::wxTaskBarIconArea(wxTaskBarIcon *icon, const wxBitmap &bmp)
                    _T("using legacy KDE1,2 and GNOME 1.2 methods"));
         SetLegacyWMProperties();
     }
+
+#if defined(__WXGTK20__) && defined(TASKBAR_ICON_AREA_BASE_INCLUDED)
+    m_invokingWindow = icon;
+#endif
    
     // Set initial size to bitmap size (tray manager may and often will
     // change it):
@@ -149,7 +160,8 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp)
         m_bmp = wxBitmap(img);
     }
 
-    wxRegion region(m_bmp);
+    wxRegion region;
+    region.Union(m_bmp);
 
     // if the bitmap is smaller than the window, offset it:
     if (winsize != iconsize)
@@ -309,7 +321,6 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu)
 {
     if (!m_iconWnd)
         return false;
-    wxSize size(m_iconWnd->GetClientSize());
-    m_iconWnd->PopupMenu(menu, size.x/2, size.y/2);
+    m_iconWnd->PopupMenu(menu);
     return true;
 }