X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c42404a58eac2c9eb0557565a471a794c387a715..02a1dfbae942c883d8651e34dcfbc5153aabc56e:/src/msw/taskbar.cpp diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index fc4f1cb9ca..fa2ae43111 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -113,10 +113,10 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) notifyData.hWnd = (HWND) m_hWnd; notifyData.uCallbackMessage = sm_taskbarMsg; notifyData.uFlags = NIF_MESSAGE ; - if (icon.Ok()) + if (icon.Ok()) { - notifyData.uFlags |= NIF_ICON; - notifyData.hIcon = (HICON) icon.GetHICON(); + notifyData.uFlags |= NIF_ICON; + notifyData.hIcon = (HICON) icon.GetHICON(); } if (((const wxChar*) tooltip != NULL) && (tooltip != wxT(""))) @@ -182,8 +182,14 @@ bool wxTaskBarIcon::PopupMenu(wxMenu *menu) //, int x, int y); menu->UpdateUI(); + // Work around a WIN32 bug + ::SetForegroundWindow ((HWND) win->GetHWND ()); + rval = win->PopupMenu(menu, 0, 0); + // Work around a WIN32 bug + ::PostMessage ((HWND) win->GetHWND(),WM_NULL,0,0L); + win->PopEventHandler(FALSE); win->Destroy(); delete win; @@ -349,9 +355,7 @@ long wxTaskBarIcon::WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wPar } if (eventType) { - wxEvent event; - event.SetEventType(eventType); - event.SetEventObject(this); + wxTaskBarIconEvent event(eventType, this); ProcessEvent(event); }