]> git.saurik.com Git - wxWidgets.git/commitdiff
cgimagecreate from wxbitmap crashes 10.2 - turn off. Put in right click handler to...
authorRyan Norton <wxprojects@comcast.net>
Wed, 9 Mar 2005 18:54:52 +0000 (18:54 +0000)
committerRyan Norton <wxprojects@comcast.net>
Wed, 9 Mar 2005 18:54:52 +0000 (18:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/carbon/taskbarosx.h
src/mac/carbon/taskbar.cpp

index 242e8781e235dcaf25ff19488504525ba999f4cc..362d87260b932a14cb054d159ce10fa40cda66e7 100644 (file)
@@ -55,7 +55,9 @@ protected:
     wxMenu* m_pMenu;
     WXHMENU m_theLastMenu;
     bool m_iconAdded;
-            
+    
+    void OnRightDown(wxTaskBarIconEvent& evt);
+    
     DECLARE_DYNAMIC_CLASS(wxTaskBarIcon)
 };
 #endif
index 74490f125cccc129b2da9e8091fb1510ecd6b8a0..9c46425f454161cb39bda795ecc6f464455da7dd 100644 (file)
@@ -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