]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/taskbar.cpp
Removing some level 3 warning
[wxWidgets.git] / src / msw / taskbar.cpp
index e9ba5a03c6f7c55cfee7ee6af71ab87b8266739c..36d0de6c5235e3e2ed03d63d09e331ec6e733358 100644 (file)
@@ -26,6 +26,7 @@
 #include "wx/window.h"
 #include "wx/frame.h"
 #include "wx/utils.h"
+#include "wx/menu.h"
 #endif
 
 #if defined(__WIN95__) && !defined(__TWIN32__)
@@ -157,6 +158,16 @@ bool wxTaskBarIcon::RemoveIcon(void)
 
 bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y);
 {
+    // OK, so I know this isn't thread-friendly, but
+    // what to do? We need this check.
+
+    static bool s_inPopup = FALSE;
+
+    if (s_inPopup)
+        return FALSE;
+
+    s_inPopup = TRUE;
+
     bool        rval = FALSE;
     wxWindow*   win;
     int         x, y;
@@ -170,12 +181,16 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y);
     // if we try to exit right now.
     wxTopLevelWindows.DeleteObject(win);
 
+    menu->UpdateUI();
+
     rval = win->PopupMenu(menu, 0, 0);
 
     win->PopEventHandler(FALSE);
     win->Destroy();
     delete win;
 
+    s_inPopup = FALSE;
+
     return rval;
 }