aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2015-02-11 09:07:24 +0100
committerMartin Rudalics2015-02-11 09:07:24 +0100
commit02138cb0b88c5f6addf891d725967d9867eda3f9 (patch)
tree073bd7e1c58cee1f02a52ff8eabcfa6dd24a6fb2 /src
parent6ebbeafc94a35e49fc3a842b5f5fbd7b069ce936 (diff)
downloademacs-02138cb0b88c5f6addf891d725967d9867eda3f9.tar.gz
emacs-02138cb0b88c5f6addf891d725967d9867eda3f9.zip
Improve toggling fullscreen state of frames.
* frame.el (toggle-frame-maximized, toggle-frame-fullscreen): Rename frame parameter `maximized' to `fullscreen-restore'. Restore fullwidth/-height after fullboth state. Update doc-strings. * w32term.c (w32_read_socket): In SIZE_MAXIMIZED and SIZE_RESTORED cases correctly handle `maximized' value for the `fullscreen' parameter. Don't use the 'maximized' parameter any more. (w32fullscreen_hook): Include menu bar height when calculating new text height in FULLSCREEN_BOTH case. * xterm.c (do_ewmh_fullscreen): Handle transition from FULLSCREEN_BOTH to FULLSCREEN_MAXIMIZED when x_frame_normalize_before_maximize is set. * frames.texi (Size Parameters): Update description of fullscreen frame parameter.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/w32term.c30
-rw-r--r--src/xterm.c10
3 files changed, 42 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b4abdc59045..f8e65d5d91d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12015-02-11 Martin Rudalics <rudalics@gmx.at>
2
3 * w32term.c (w32_read_socket): In SIZE_MAXIMIZED and
4 SIZE_RESTORED cases correctly handle `maximized' value for the
5 `fullscreen' parameter. Don't use 'maximized' frame parameter
6 any more.
7 (w32fullscreen_hook): Include menu bar height when calculating
8 new text height in FULLSCREEN_BOTH case.
9 * xterm.c (do_ewmh_fullscreen): Handle transition from
10 FULLSCREEN_BOTH to FULLSCREEN_MAXIMIZED when
11 x_frame_normalize_before_maximize is set.
12
12015-02-10 Paul Eggert <eggert@cs.ucla.edu> 132015-02-10 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 Use bool for boolean in xdisp.c 15 Use bool for boolean in xdisp.c
diff --git a/src/w32term.c b/src/w32term.c
index fb9d2388d6b..a9ed2a852da 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5052,6 +5052,7 @@ w32_read_socket (struct terminal *terminal,
5052 case SIZE_MAXIMIZED: 5052 case SIZE_MAXIMIZED:
5053 { 5053 {
5054 bool iconified = FRAME_ICONIFIED_P (f); 5054 bool iconified = FRAME_ICONIFIED_P (f);
5055 Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
5055 5056
5056 SET_FRAME_VISIBLE (f, 1); 5057 SET_FRAME_VISIBLE (f, 1);
5057 SET_FRAME_ICONIFIED (f, false); 5058 SET_FRAME_ICONIFIED (f, false);
@@ -5082,12 +5083,22 @@ w32_read_socket (struct terminal *terminal,
5082 to update the frame titles 5083 to update the frame titles
5083 in case this is the second frame. */ 5084 in case this is the second frame. */
5084 record_asynch_buffer_change (); 5085 record_asynch_buffer_change ();
5085 }
5086 5086
5087 if (EQ (get_frame_param (f, Qfullscreen), Qnil)) 5087 /* Windows can send us a SIZE_MAXIMIZED message even
5088 set_frame_param (f, Qfullscreen, Qmaximized); 5088 when fullscreen is fullboth. The following is a
5089 else if (! EQ (get_frame_param (f, Qfullscreen), Qmaximized)) 5089 simple hack to check that based on the fact that
5090 set_frame_param (f, Qmaximized, Qmaximized); 5090 only a maximized fullscreen frame should have both
5091 top/left outside the screen. */
5092 if (EQ (fullscreen, Qfullwidth) || EQ (fullscreen, Qfullheight)
5093 || NILP (fullscreen))
5094 {
5095 int x, y;
5096
5097 x_real_positions (f, &x, &y);
5098 if (x < 0 && y < 0)
5099 store_frame_param (f, Qfullscreen, Qmaximized);
5100 }
5101 }
5091 5102
5092 break; 5103 break;
5093 5104
@@ -5128,9 +5139,7 @@ w32_read_socket (struct terminal *terminal,
5128 } 5139 }
5129 5140
5130 if (EQ (get_frame_param (f, Qfullscreen), Qmaximized)) 5141 if (EQ (get_frame_param (f, Qfullscreen), Qmaximized))
5131 set_frame_param (f, Qfullscreen, Qnil); 5142 store_frame_param (f, Qfullscreen, Qnil);
5132 else if (! EQ (get_frame_param (f, Qmaximized), Qnil))
5133 set_frame_param (f, Qmaximized, Qnil);
5134 5143
5135 break; 5144 break;
5136 } 5145 }
@@ -6008,6 +6017,8 @@ w32fullscreen_hook (struct frame *f)
6008 } 6017 }
6009 else if (f->want_fullscreen == FULLSCREEN_BOTH) 6018 else if (f->want_fullscreen == FULLSCREEN_BOTH)
6010 { 6019 {
6020 int menu_bar_height = GetSystemMetrics (SM_CYMENU);
6021
6011 w32_fullscreen_rect (hwnd, f->want_fullscreen, 6022 w32_fullscreen_rect (hwnd, f->want_fullscreen,
6012 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); 6023 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
6013 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); 6024 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
@@ -6016,7 +6027,8 @@ w32fullscreen_hook (struct frame *f)
6016 SWP_NOOWNERZORDER | SWP_FRAMECHANGED); 6027 SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
6017 change_frame_size 6028 change_frame_size
6018 (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, rect.right - rect.left), 6029 (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, rect.right - rect.left),
6019 FRAME_PIXEL_TO_TEXT_HEIGHT (f, rect.bottom - rect.top), 6030 FRAME_PIXEL_TO_TEXT_HEIGHT (f, (rect.bottom - rect.top
6031 - menu_bar_height)),
6020 0, 1, 0, 1); 6032 0, 1, 0, 1);
6021 } 6033 }
6022 else 6034 else
diff --git a/src/xterm.c b/src/xterm.c
index 6a63a454bac..0b3efe7b4b6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9271,7 +9271,15 @@ do_ewmh_fullscreen (struct frame *f)
9271 } 9271 }
9272 break; 9272 break;
9273 case FULLSCREEN_MAXIMIZED: 9273 case FULLSCREEN_MAXIMIZED:
9274 if (x_frame_normalize_before_maximize && cur == FULLSCREEN_WIDTH) 9274 if (x_frame_normalize_before_maximize && cur == FULLSCREEN_BOTH)
9275 {
9276 set_wm_state (frame, false,
9277 dpyinfo->Xatom_net_wm_state_fullscreen, None);
9278 set_wm_state (frame, true,
9279 dpyinfo->Xatom_net_wm_state_maximized_horz,
9280 dpyinfo->Xatom_net_wm_state_maximized_vert);
9281 }
9282 else if (x_frame_normalize_before_maximize && cur == FULLSCREEN_WIDTH)
9275 { 9283 {
9276 set_wm_state (frame, false, 9284 set_wm_state (frame, false,
9277 dpyinfo->Xatom_net_wm_state_maximized_horz, None); 9285 dpyinfo->Xatom_net_wm_state_maximized_horz, None);