forked from bartvdbraak/blender
Win32: Fix fullscreen errors using Taskbar system menu
Changing window state using taskbar system menu could result in a titleless window. Differential Revision: https://developer.blender.org/D10812 Reviewed by Ray Molenkamp
This commit is contained in:
parent
e96f0d2e2b
commit
c037a02096
@ -1442,12 +1442,23 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
|
||||
*/
|
||||
break;
|
||||
case WM_SYSCOMMAND:
|
||||
/* The WM_SYSCHAR message is sent to the window when system commands such as
|
||||
/* The WM_SYSCOMMAND message is sent to the window when system commands such as
|
||||
* maximize, minimize or close the window are triggered. Also it is sent when ALT
|
||||
* button is press for menu. To prevent this we must return preventing DefWindowProc.
|
||||
*
|
||||
* Note that the four low-order bits of the wParam parameter are used internally by the
|
||||
* OS. 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.
|
||||
*/
|
||||
if (wParam == SC_KEYMENU) {
|
||||
eventHandled = true;
|
||||
switch (wParam & 0xFFF0) {
|
||||
case SC_KEYMENU:
|
||||
eventHandled = true;
|
||||
break;
|
||||
case SC_RESTORE:
|
||||
::ShowWindow(hwnd, SW_RESTORE);
|
||||
window->setState(window->getState());
|
||||
eventHandled = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
@ -521,7 +521,7 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state)
|
||||
|
||||
switch (state) {
|
||||
case GHOST_kWindowStateMinimized:
|
||||
wp.showCmd = SW_SHOWMINIMIZED;
|
||||
wp.showCmd = SW_MINIMIZE;
|
||||
break;
|
||||
case GHOST_kWindowStateMaximized:
|
||||
wp.showCmd = SW_SHOWMAXIMIZED;
|
||||
|
Loading…
Reference in New Issue
Block a user