+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.
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;
rect->right = normal.right;
rect->bottom = mi.rcWork.bottom;
break;
- case FULLSCREEN_NONE:
default:
*rect = normal;
break;
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,
}
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);
}