[PATCH 5/5] explorer/systray: send WM_CONTEXTMENU on WM_RBUTTONUP and NIN_SELECT on WM_LBUTTONUP

Roman Pisl rpisl at seznam.cz
Mon Oct 10 09:35:42 CDT 2016


Fixes https://bugs.winehq.org/show_bug.cgi?id=29412

Tested on Gentoo Linux and Qt 4.8/5.5.

Signed-off-by: Roman Pisl <rpisl at seznam.cz>
---
 programs/explorer/systray.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index bd05a4f..fe86403 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -832,6 +832,25 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
             ret = PostMessageW(icon->owner, icon->callback_message, wpar,
                                oldver ? msg : MAKELPARAM(msg, icon->id));
 
+            if (ret && icon->version > 0) {
+                switch (msg) {
+                    case WM_RBUTTONUP:
+                        /* notify the owner hwnd of the message */
+                        WINE_TRACE("relaying 0x%x\n", WM_CONTEXTMENU);
+                        ret = PostMessageW(icon->owner, icon->callback_message, wpar,
+                                           oldver ? WM_CONTEXTMENU : MAKELPARAM(WM_CONTEXTMENU, icon->id));
+                        break;
+                    case WM_LBUTTONUP:
+                        /* notify the owner hwnd of the message */
+                        WINE_TRACE("relaying 0x%x\n", NIN_SELECT);
+                        ret = PostMessageW(icon->owner, icon->callback_message, wpar,
+                                          oldver ? NIN_SELECT : MAKELPARAM(NIN_SELECT, icon->id));
+                        break;
+                    default:
+                        break;
+                }
+            }
+
             if (!ret && (GetLastError() == ERROR_INVALID_WINDOW_HANDLE))
             {
                 WINE_WARN("application window was destroyed without removing "
-- 
2.7.3




More information about the wine-patches mailing list