summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.c
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2023-11-27 01:16:54 -0500
committersfan5 <sfan5@live.de>2023-12-06 11:07:37 +0100
commit79068baf43720028d239446a71d383a95e18a4ac (patch)
tree9d61818ed946a2f59cd17865f3efec77fc87fb5a /video/out/w32_common.c
parent4c47dbe22c8afedbb3603e4acb23621277f5ef43 (diff)
downloadmpv-79068baf43720028d239446a71d383a95e18a4ac.tar.bz2
mpv-79068baf43720028d239446a71d383a95e18a4ac.tar.xz
win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWN
According to MS documentation, an application should return TRUE from WM_XBUTTONUP and WM_XBUTTONDOWN if it processes these messages. DefWindowProc generates the WM_APPCOMMAND message when it processes the WM_XBUTTONUP message, so if an application properly handles WM_XBUTTONUP messages, extra WM_APPCOMMAND messages won't be generated. Because mpv doesn't properly handle these messages, WM_XBUTTONUP causes APPCOMMAND_BROWSER_BACKWARD to be generated, resulting in duplicated keys and improper fix 438ead7a, which prevents the processing of the appcommand from sources other than mouse clicks. Fix this by following the documentation, and the back and forward appcommands can be added.
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r--video/out/w32_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index e6a4670d2d..5672ea31a4 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -1480,11 +1480,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
handle_mouse_down(w32,
HIWORD(wParam) == 1 ? MP_MBTN_BACK : MP_MBTN_FORWARD,
GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
- break;
+ return TRUE;
case WM_XBUTTONUP:
handle_mouse_up(w32,
HIWORD(wParam) == 1 ? MP_MBTN_BACK : MP_MBTN_FORWARD);
- break;
+ return TRUE;
case WM_DISPLAYCHANGE:
force_update_display_info(w32);
break;