From: Ryan Norton Date: Wed, 9 Mar 2005 18:54:52 +0000 (+0000) Subject: cgimagecreate from wxbitmap crashes 10.2 - turn off. Put in right click handler to... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b14ba1f11722aeb4e4dcd52a686f5a50335776a1?ds=inline cgimagecreate from wxbitmap crashes 10.2 - turn off. Put in right click handler to avoid double-creation of the menus git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/carbon/taskbarosx.h b/include/wx/mac/carbon/taskbarosx.h index 242e8781e2..362d87260b 100644 --- a/include/wx/mac/carbon/taskbarosx.h +++ b/include/wx/mac/carbon/taskbarosx.h @@ -55,7 +55,9 @@ protected: wxMenu* m_pMenu; WXHMENU m_theLastMenu; bool m_iconAdded; - + + void OnRightDown(wxTaskBarIconEvent& evt); + DECLARE_DYNAMIC_CLASS(wxTaskBarIcon) }; #endif diff --git a/src/mac/carbon/taskbar.cpp b/src/mac/carbon/taskbar.cpp index 74490f125c..9c46425f45 100644 --- a/src/mac/carbon/taskbar.cpp +++ b/src/mac/carbon/taskbar.cpp @@ -143,6 +143,8 @@ wxTaskBarIcon::wxTaskBarIcon(const wxTaskBarIconType& nType) this, (&(EventHandlerRef&)m_pEventHandlerRef)); wxASSERT(err == noErr); + + Connect(wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEventHandler(wxTaskBarIcon::OnRightDown)); } wxTaskBarIcon::~wxTaskBarIcon() @@ -181,7 +183,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) CGImageRef pImage; -#if 1 // is always available under OSX now +#if 0 // is always available under OSX now -- crashes on 10.2 in CFRetain() - RN pImage = (CGImageRef) bmp.CGImageCreate() ; #else WXHBITMAP iconport ; @@ -289,4 +291,10 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) return true; } +//Skip the event so that popupmenu isn't called in parent, avoiding double-creation of the menus +void wxTaskBarIcon::OnRightDown(wxTaskBarIconEvent& evt) +{ + evt.Skip(); +} + #endif //wxHAS_TASK_BAR_ICON