diff options
author | pavelxdd <pavel.otchertsov@gmail.com> | 2016-12-16 18:53:09 +0300 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2017-01-05 17:23:03 +1100 |
commit | 0e7dd6d4ff3c7510a147ba68f43040828dcf486f (patch) | |
tree | 49a8b6978c7c8d59039662cf9c26998a456e956b | |
parent | 2ff0745ddb4b46b76c1e207e692e4f176c82e0b8 (diff) | |
download | mpv-0e7dd6d4ff3c7510a147ba68f43040828dcf486f.tar.bz2 mpv-0e7dd6d4ff3c7510a147ba68f43040828dcf486f.tar.xz |
win32: fix for wm_syscommand
According to MSDN, in WM_SYSCOMMAND messages, the four low-order
bits of the wParam parameter are used internally by the system.
To obtain the correct result when testing the value of wParam,
an application must combine the value 0xFFF0 with the wParam
value by using the bitwise AND operator.
-rw-r--r-- | video/out/w32_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 0de9148257..dad9b10799 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -786,7 +786,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, PostQuitMessage(0); break; case WM_SYSCOMMAND: - switch (wParam) { + switch (wParam & 0xFFF0) { case SC_SCREENSAVE: case SC_MONITORPOWER: if (w32->disable_screensaver) { |