[EXPLORER] Follow-up of #4718 (ba2cead)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 22 Sep 2022 23:25:27 +0000 (08:25 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 22 Sep 2022 23:25:27 +0000 (08:25 +0900)
Handle click OnNcLButtonUp instead of OnNcLButtonDown/OnNcLButtonDblClick.
CORE-15369

base/shell/explorer/traywnd.cpp

index b3384a4..2b648e8 100644 (file)
@@ -2861,9 +2861,6 @@ ChangePos:
 
         bHandled = FALSE;
 
-        if (CheckShowDesktopButtonClick(lParam, bHandled))
-            return TRUE;
-
         RECT rcStartBtn;
         m_StartButton.GetWindowRect(&rcStartBtn);
 
@@ -3038,9 +3035,6 @@ HandleTrayContextMenu:
 
     LRESULT OnNcLButtonDblClick(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
     {
-        if (CheckShowDesktopButtonClick(lParam, bHandled))
-            return TRUE;
-
         /* Let the clock handle the double click */
         ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
 
@@ -3049,6 +3043,14 @@ HandleTrayContextMenu:
         return TRUE;
     }
 
+    LRESULT OnNcLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+    {
+        if (CheckShowDesktopButtonClick(lParam, bHandled))
+            return 0;
+
+        return 0;
+    }
+
     LRESULT OnAppTrayDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
     {
         DestroyWindow();
@@ -3423,6 +3425,7 @@ HandleTrayContextMenu:
         MESSAGE_HANDLER(WM_SYSCHAR, OnSysChar)
         MESSAGE_HANDLER(WM_NCRBUTTONUP, OnNcRButtonUp)
         MESSAGE_HANDLER(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClick)
+        MESSAGE_HANDLER(WM_NCLBUTTONUP, OnNcLButtonUp)
         MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
         MESSAGE_HANDLER(WM_NCMOUSEMOVE, OnMouseMove)
         MESSAGE_HANDLER(WM_APP_TRAYDESTROY, OnAppTrayDestroy)