aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorMartin Rudalics2014-01-04 10:31:30 +0100
committerMartin Rudalics2014-01-04 10:31:30 +0100
commit5159d5902f0a6f48b354bc568f086d99c2e64ea0 (patch)
treeb12715cf886b6906d1953a02b21a812658d26f43 /src/w32term.c
parenta71324ccb69f9e3af5b1c613a60111c8f3885ce0 (diff)
downloademacs-5159d5902f0a6f48b354bc568f086d99c2e64ea0.tar.gz
emacs-5159d5902f0a6f48b354bc568f086d99c2e64ea0.zip
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.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 91235507b21..a59d5d6edc0 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5564,18 +5564,22 @@ w32fullscreen_hook (struct frame *f)
5564 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH) 5564 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH)
5565 { 5565 {
5566 SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW); 5566 SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
5567 SetWindowPos (hwnd, NULL, 0, 0, 0, 0, 5567 SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f));
5568 SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | 5568 }
5569 SWP_NOOWNERZORDER | SWP_FRAMECHANGED); 5569 else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT
5570 } 5570 || FRAME_PREV_FSMODE (f) == FULLSCREEN_WIDTH)
5571 SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f));
5571 5572
5572 w32_fullscreen_rect (hwnd, f->want_fullscreen,
5573 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
5574 FRAME_PREV_FSMODE (f) = f->want_fullscreen; 5573 FRAME_PREV_FSMODE (f) = f->want_fullscreen;
5575 if (f->want_fullscreen == FULLSCREEN_MAXIMIZED) 5574
5576 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0); 5575 if (f->want_fullscreen == FULLSCREEN_NONE)
5576 ShowWindow (hwnd, SW_SHOWNORMAL);
5577 else if (f->want_fullscreen == FULLSCREEN_MAXIMIZED)
5578 ShowWindow (hwnd, SW_MAXIMIZE);
5577 else if (f->want_fullscreen == FULLSCREEN_BOTH) 5579 else if (f->want_fullscreen == FULLSCREEN_BOTH)
5578 { 5580 {
5581 w32_fullscreen_rect (hwnd, f->want_fullscreen,
5582 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
5579 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); 5583 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
5580 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, 5584 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
5581 rect.right - rect.left, rect.bottom - rect.top, 5585 rect.right - rect.left, rect.bottom - rect.top,
@@ -5583,6 +5587,9 @@ w32fullscreen_hook (struct frame *f)
5583 } 5587 }
5584 else 5588 else
5585 { 5589 {
5590 ShowWindow (hwnd, SW_SHOWNORMAL);
5591 w32_fullscreen_rect (hwnd, f->want_fullscreen,
5592 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
5586 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, 5593 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
5587 rect.right - rect.left, rect.bottom - rect.top, 0); 5594 rect.right - rect.left, rect.bottom - rect.top, 0);
5588 } 5595 }