1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 00:02:13 +00:00

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.
This commit is contained in:
pavelxdd 2016-12-16 18:53:09 +03:00 committed by James Ross-Gowan
parent 2ff0745ddb
commit 0e7dd6d4ff

View File

@ -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) {