mirror of https://github.com/mpv-player/mpv
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:
parent
2ff0745ddb
commit
0e7dd6d4ff
|
@ -786,7 +786,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
switch (wParam) {
|
switch (wParam & 0xFFF0) {
|
||||||
case SC_SCREENSAVE:
|
case SC_SCREENSAVE:
|
||||||
case SC_MONITORPOWER:
|
case SC_MONITORPOWER:
|
||||||
if (w32->disable_screensaver) {
|
if (w32->disable_screensaver) {
|
||||||
|
|
Loading…
Reference in New Issue