From: Robin Dunn Date: Tue, 1 Jun 2004 21:42:57 +0000 (+0000) Subject: Handle the (probably rare) case where the icon has no mask. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/eb03e0e714b162912f70a78de14cc5e1e070fd86?ds=inline Handle the (probably rare) case where the icon has no mask. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index 5b4704bc53..99ed4fb030 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -139,7 +139,7 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp) // determine suitable bitmap size: wxSize winsize(GetSize()); wxSize bmpsize(m_bmp.GetWidth(), m_bmp.GetHeight()); - wxSize iconsize(wxMin(winsize.x, bmpsize.x), wxMin(winsize.y, bmpsize.y)); + wxSize iconsize(wxMin(winsize.x-2, bmpsize.x), wxMin(winsize.y-2, bmpsize.y)); // rescale the bitmap to fit into the tray icon window: if (bmpsize != iconsize) @@ -149,7 +149,11 @@ void wxTaskBarIconArea::SetTrayIcon(const wxBitmap& bmp) m_bmp = wxBitmap(img); } - wxRegion region(m_bmp); + wxRegion region; + if (m_bmp.GetMask()) + region.Union(m_bmp); + else + region.Union(0,0, iconsize.x, iconsize.y); // if the bitmap is smaller than the window, offset it: if (winsize != iconsize)