Commit 5159d590 authored by Martin Rudalics's avatar Martin Rudalics

Fix maximization behavior on Windows (Bug#16300).

Fix maximization behavior on Windows (Bug#16300).
* w32fns.c (w32_fullscreen_rect): Don't handle
FULLSCREEN_MAXIMIZED and FULLSCREEN_NONE specially.
* w32term.c (w32fullscreen_hook): Use SetWindowPlacement instead
of SetWindowPos.  Restore last placement also when leaving
FULLSCREEN_HEIGHT and FULLSCREEN_WIDTH.  Call ShowWindow in all
but the FULLSCREEN_BOTH case.
parent a71324cc
2014-01-04 Martin Rudalics <rudalics@gmx.at>
Fix maximization behavior on Windows (Bug#16300).
* w32fns.c (w32_fullscreen_rect): Don't handle
FULLSCREEN_MAXIMIZED and FULLSCREEN_NONE specially.
* w32term.c (w32fullscreen_hook): Use SetWindowPlacement instead
of SetWindowPos. Restore last placement also when leaving
FULLSCREEN_HEIGHT and FULLSCREEN_WIDTH. Call ShowWindow in all
but the FULLSCREEN_BOTH case.
2014-01-03 Paul Eggert <eggert@cs.ucla.edu>
Port to C89.
......
......@@ -402,12 +402,6 @@ w32_fullscreen_rect (HWND hwnd, int fsmode, RECT normal, RECT *rect)
rect->right = mi.rcMonitor.right;
rect->bottom = mi.rcMonitor.bottom;
break;
case FULLSCREEN_MAXIMIZED:
rect->left = mi.rcWork.left;
rect->top = mi.rcWork.top;
rect->right = mi.rcWork.right;
rect->bottom = mi.rcWork.bottom;
break;
case FULLSCREEN_WIDTH:
rect->left = mi.rcWork.left;
rect->top = normal.top;
......@@ -420,7 +414,6 @@ w32_fullscreen_rect (HWND hwnd, int fsmode, RECT normal, RECT *rect)
rect->right = normal.right;
rect->bottom = mi.rcWork.bottom;
break;
case FULLSCREEN_NONE:
default:
*rect = normal;
break;
......
......@@ -5564,18 +5564,22 @@ w32fullscreen_hook (struct frame *f)
if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH)
{
SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
SetWindowPos (hwnd, NULL, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
}
SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f));
}
else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT
|| FRAME_PREV_FSMODE (f) == FULLSCREEN_WIDTH)
SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f));
w32_fullscreen_rect (hwnd, f->want_fullscreen,
FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
FRAME_PREV_FSMODE (f) = f->want_fullscreen;
if (f->want_fullscreen == FULLSCREEN_MAXIMIZED)
PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
if (f->want_fullscreen == FULLSCREEN_NONE)
ShowWindow (hwnd, SW_SHOWNORMAL);
else if (f->want_fullscreen == FULLSCREEN_MAXIMIZED)
ShowWindow (hwnd, SW_MAXIMIZE);
else if (f->want_fullscreen == FULLSCREEN_BOTH)
{
w32_fullscreen_rect (hwnd, f->want_fullscreen,
FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
......@@ -5583,6 +5587,9 @@ w32fullscreen_hook (struct frame *f)
}
else
{
ShowWindow (hwnd, SW_SHOWNORMAL);
w32_fullscreen_rect (hwnd, f->want_fullscreen,
FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment