X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/971562cb51391676afccb9822e491d677f052c0d..c3b501e187fdb318911177e5ad90fea9e163a112:/src/unix/taskbarx11.cpp diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index 759be00a01..4f8040c809 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "taskbarx11.h" -#endif - // NB: This implementation does *not* work with every X11 window manager. // Currently only GNOME 1.2 and KDE 1,2,3 methods are implemented here. // Freedesktop.org's System Tray specification is implemented in @@ -32,6 +28,7 @@ #include "wx/sizer.h" #include "wx/dcclient.h" #include "wx/log.h" +#include "wx/image.h" #ifdef __VMS #pragma message disable nosimpint @@ -47,8 +44,14 @@ // ---------------------------------------------------------------------------- #ifdef __WXGTK20__ - #include "wx/gtk/taskbarpriv.h" -#else + #include + #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 +127,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): @@ -150,10 +157,7 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp) } wxRegion region; - if (m_bmp.GetMask()) - region.Union(m_bmp); - else - region.Union(0,0, iconsize.x, iconsize.y); + region.Union(m_bmp); // if the bitmap is smaller than the window, offset it: if (winsize != iconsize) @@ -313,7 +317,6 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) { if (!m_iconWnd) return false; - wxSize size(m_iconWnd->GetClientSize()); m_iconWnd->PopupMenu(menu); return true; }