diff options
| -rw-r--r-- | doc/emacs/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/emacs/cmdargs.texi | 15 | ||||
| -rw-r--r-- | doc/emacs/xresources.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 12 | ||||
| -rw-r--r-- | etc/ChangeLog | 4 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/startup.el | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 37 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 108 | ||||
| -rw-r--r-- | src/frame.h | 13 | ||||
| -rw-r--r-- | src/gtkutil.c | 116 | ||||
| -rw-r--r-- | src/xterm.c | 162 |
15 files changed, 226 insertions, 269 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index c3cd2ed798f..7aa53be2d99 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xresources.texi (Table of Resources): Mention maximized for | ||
| 4 | fullscreen. | ||
| 5 | |||
| 6 | * cmdargs.texi (Window Size X): -mm/--maximized is new. | ||
| 7 | |||
| 1 | 2009-07-01 Chong Yidong <cyd@stupidchicken.com> | 8 | 2009-07-01 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * anti.texi (Antinews): Correct the list of removed platforms. | 10 | * anti.texi (Antinews): Correct the list of removed platforms. |
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 2d4d8b3d1a1..1438c19c123 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -1184,7 +1184,16 @@ the initial frame. | |||
| 1184 | @itemx --fullscreen | 1184 | @itemx --fullscreen |
| 1185 | @opindex --fullscreen | 1185 | @opindex --fullscreen |
| 1186 | @cindex fullscreen, command-line argument | 1186 | @cindex fullscreen, command-line argument |
| 1187 | Specify that width and height shall be the size of the screen. | 1187 | Specify that width and height shall be the size of the screen. Normally |
| 1188 | no window manager decorations are shown. | ||
| 1189 | |||
| 1190 | @item -mm | ||
| 1191 | @opindex -mm | ||
| 1192 | @itemx --maximized | ||
| 1193 | @opindex --maximized | ||
| 1194 | @cindex maximized, command-line argument | ||
| 1195 | Specify that the Emacs frame shall be maximized. This normally | ||
| 1196 | means that the frame has window manager decorations. | ||
| 1188 | 1197 | ||
| 1189 | @item -fh | 1198 | @item -fh |
| 1190 | @opindex -fh | 1199 | @opindex -fh |
| @@ -1258,8 +1267,8 @@ size with no tool bar, use an X resource to specify ``no tool bar'' | |||
| 1258 | (@pxref{Table of Resources}); then Emacs will already know there's no | 1267 | (@pxref{Table of Resources}); then Emacs will already know there's no |
| 1259 | tool bar when it processes the specified geometry. | 1268 | tool bar when it processes the specified geometry. |
| 1260 | 1269 | ||
| 1261 | When using one of @samp{--fullscreen}, @samp{--fullwidth} or | 1270 | When using one of @samp{--fullscreen}, @samp{--maximized}, @samp{--fullwidth} |
| 1262 | @samp{--fullheight} there may be some space around the frame | 1271 | or @samp{--fullheight} there may be some space around the frame |
| 1263 | anyway. That is because Emacs rounds the sizes so they are an | 1272 | anyway. That is because Emacs rounds the sizes so they are an |
| 1264 | even number of character heights and widths. | 1273 | even number of character heights and widths. |
| 1265 | 1274 | ||
diff --git a/doc/emacs/xresources.texi b/doc/emacs/xresources.texi index a2deb1530ae..f471b9dd148 100644 --- a/doc/emacs/xresources.texi +++ b/doc/emacs/xresources.texi | |||
| @@ -217,8 +217,8 @@ all frames. | |||
| 217 | @ifnottex | 217 | @ifnottex |
| 218 | @item @code{fullscreen} (class @code{Fullscreen}) | 218 | @item @code{fullscreen} (class @code{Fullscreen}) |
| 219 | The desired fullscreen size. The value can be one of @code{fullboth}, | 219 | The desired fullscreen size. The value can be one of @code{fullboth}, |
| 220 | @code{fullwidth} or @code{fullheight}, which correspond to | 220 | @code{maximized}, @code{fullwidth} or @code{fullheight}, which correspond to |
| 221 | the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh} | 221 | the command-line options @samp{-fs}, @samp{-mm}, @samp{-fw}, and @samp{-fh} |
| 222 | (@pxref{Window Size X}). | 222 | (@pxref{Window Size X}). |
| 223 | 223 | ||
| 224 | Note that this applies to the initial frame only. | 224 | Note that this applies to the initial frame only. |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index dbff044e68c..e985de0cc37 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * frames.texi (Size Parameters): Mention maximized for fullscreen. | ||
| 4 | |||
| 1 | 2009-06-24 Chong Yidong <cyd@stupidchicken.com> | 5 | 2009-06-24 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * display.texi (Window Systems): Add ns to the list. | 7 | * display.texi (Window Systems): Add ns to the list. |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 87127c9cd66..85bf2bb75e7 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -609,11 +609,15 @@ the @code{user-position} parameter (see above) does for the position | |||
| 609 | parameters @code{top} and @code{left}. | 609 | parameters @code{top} and @code{left}. |
| 610 | 610 | ||
| 611 | @item fullscreen | 611 | @item fullscreen |
| 612 | Specify that width, height or both shall be set to the size of the screen. | 612 | Specify that width, height or both shall be maximized. |
| 613 | The value @code{fullwidth} specifies that width shall be the size of the | 613 | The value @code{fullwidth} specifies that width shall as wide as possible. |
| 614 | screen. The value @code{fullheight} specifies that height shall be the | 614 | The value @code{fullheight} specifies that height shall be as tall as |
| 615 | size of the screen. The value @code{fullboth} specifies that both the | 615 | possible. The value @code{fullboth} specifies that both the |
| 616 | width and the height shall be set to the size of the screen. | 616 | width and the height shall be set to the size of the screen. |
| 617 | The value @code{maximized} specifies that the frame shall be maximized. | ||
| 618 | The difference between @code{maximized} and @code{fullboth} is that | ||
| 619 | the first does have window manager decorations but the second does not | ||
| 620 | and thus really covers the whole screen. | ||
| 617 | @end table | 621 | @end table |
| 618 | 622 | ||
| 619 | @node Layout Parameters | 623 | @node Layout Parameters |
diff --git a/etc/ChangeLog b/etc/ChangeLog index 71edd4cde44..f376af7554d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * NEWS: Mention maximized. | ||
| 4 | |||
| 1 | 2009-06-30 Michael Albinus <michael.albinus@gmx.de> | 5 | 2009-06-30 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * NEWS: Add "synce" connection method of Tramp. | 7 | * NEWS: Add "synce" connection method of Tramp. |
| @@ -30,6 +30,11 @@ freedesktop.org specifications, the same method used by the Gnome, | |||
| 30 | KDE, and XFCE desktops. (This change has no effect on Windows, which | 30 | KDE, and XFCE desktops. (This change has no effect on Windows, which |
| 31 | uses `system-move-file-to-trash' for trashing.) | 31 | uses `system-move-file-to-trash' for trashing.) |
| 32 | 32 | ||
| 33 | +++ | ||
| 34 | ** Emacs frames can be maximized. | ||
| 35 | The command line arguments -mm/--maximized and the value maximized to the | ||
| 36 | frame parameter fullscreen makes the Emacs frame maximized. | ||
| 37 | |||
| 33 | 38 | ||
| 34 | * Changes in Specialized Modes and Packages in Emacs 23.2 | 39 | * Changes in Specialized Modes and Packages in Emacs 23.2 |
| 35 | 40 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f2327532354..c2d602380c1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * startup.el (command-line-x-option-alist): Add -mm and --maximized. | ||
| 4 | |||
| 1 | 2009-07-01 Eduard Wiebe <usenet@pusto.de> (tiny change) | 5 | 2009-07-01 Eduard Wiebe <usenet@pusto.de> (tiny change) |
| 2 | 6 | ||
| 3 | * language/korean.el (set-language-info-alist): Add korean-cp949, | 7 | * language/korean.el (set-language-info-alist): Add korean-cp949, |
diff --git a/lisp/startup.el b/lisp/startup.el index 15e65bd9eb4..c28a2fe599c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -134,6 +134,7 @@ This is normally copied from `default-directory' when Emacs starts.") | |||
| 134 | ("-fs" 0 x-handle-initial-switch fullscreen fullboth) | 134 | ("-fs" 0 x-handle-initial-switch fullscreen fullboth) |
| 135 | ("-fw" 0 x-handle-initial-switch fullscreen fullwidth) | 135 | ("-fw" 0 x-handle-initial-switch fullscreen fullwidth) |
| 136 | ("-fh" 0 x-handle-initial-switch fullscreen fullheight) | 136 | ("-fh" 0 x-handle-initial-switch fullscreen fullheight) |
| 137 | ("-mm" 0 x-handle-initial-switch fullscreen maximized) | ||
| 137 | ("-ib" 1 x-handle-numeric-switch internal-border-width) | 138 | ("-ib" 1 x-handle-numeric-switch internal-border-width) |
| 138 | ("-g" 1 x-handle-geometry) | 139 | ("-g" 1 x-handle-geometry) |
| 139 | ("-lsp" 1 x-handle-numeric-switch line-spacing) | 140 | ("-lsp" 1 x-handle-numeric-switch line-spacing) |
| @@ -159,6 +160,7 @@ This is normally copied from `default-directory' when Emacs starts.") | |||
| 159 | ("--fullscreen" 0 x-handle-initial-switch fullscreen fullboth) | 160 | ("--fullscreen" 0 x-handle-initial-switch fullscreen fullboth) |
| 160 | ("--fullwidth" 0 x-handle-initial-switch fullscreen fullwidth) | 161 | ("--fullwidth" 0 x-handle-initial-switch fullscreen fullwidth) |
| 161 | ("--fullheight" 0 x-handle-initial-switch fullscreen fullheight) | 162 | ("--fullheight" 0 x-handle-initial-switch fullscreen fullheight) |
| 163 | ("--maximized" 0 x-handle-initial-switch fullscreen maximized) | ||
| 162 | ("--internal-border" 1 x-handle-numeric-switch internal-border-width) | 164 | ("--internal-border" 1 x-handle-numeric-switch internal-border-width) |
| 163 | ("--geometry" 1 x-handle-geometry) | 165 | ("--geometry" 1 x-handle-geometry) |
| 164 | ("--foreground-color" 1 x-handle-switch foreground-color) | 166 | ("--foreground-color" 1 x-handle-switch foreground-color) |
diff --git a/src/ChangeLog b/src/ChangeLog index 61d2d1b7eba..9108cd39cc6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,40 @@ | |||
| 1 | 2009-07-01 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * emacs.c (USAGE3, standard_args): Add -mm and --maximized. | ||
| 4 | |||
| 5 | * frame.c: Qmaximized is new. | ||
| 6 | (x_set_frame_parameters): Do not handle fullscreen specially. | ||
| 7 | Only set width and height if explicitly set. | ||
| 8 | (x_set_fullscreen): Handle Qmaximized. | ||
| 9 | (x_set_font, x_figure_window_size): Do not handle fullscreen specially. | ||
| 10 | (syms_of_frame): Initialize Qmaximized. | ||
| 11 | |||
| 12 | * frame.h (fullscreen_type): Add FULLSCREEN_MAXIMIZED. Declare | ||
| 13 | Qfullwidth, Qfullheight, Qfullboth, Qmaximized. | ||
| 14 | |||
| 15 | * xterm.c (handle_one_xevent): Remove call to x_check_fullscreen | ||
| 16 | for Expose event. Add call to x_check_fullscreen for MapNotify event. | ||
| 17 | Remove all code w.r.t. fullscreen from ConfigureNotify event. Do not | ||
| 18 | set gravity to NorthWestGravity when USE_GTK. | ||
| 19 | (set_wm_state): New function. | ||
| 20 | (do_ewmh_fullscreen): Use set_wm_state. Also handle FULLSCREEN_MAXIMIZED. | ||
| 21 | (x_handle_net_wm_state): Handle FULLSCREEN_MAXIMIZED. | ||
| 22 | (x_check_fullscreen): Simplify so we only handle EMWH type of fullscreen | ||
| 23 | or the case when no window manager is running. That means remove calls | ||
| 24 | to x_real_positions and x_fullscreen_adjust. | ||
| 25 | |||
| 26 | * gtkutil.c (flush_and_sync, x_wm_size_hint_off): Remove. | ||
| 27 | (xg_frame_set_char_size): Remove calls to x_wm_size_hint_off and | ||
| 28 | flush_and_sync. | ||
| 29 | (xg_height_changed): New function. | ||
| 30 | (xg_create_frame_widgets): Remove call to gtk_widget_set_size_request | ||
| 31 | and gtk_window_set_policy. Set frame gravity after parsing the geometry | ||
| 32 | string. | ||
| 33 | (xg_update_frame_menubar, free_frame_menubar) | ||
| 34 | (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback) | ||
| 35 | (update_frame_tool_bar, free_frame_tool_bar): Call xg_height_changed. | ||
| 36 | Remove calls to xg_frame_set_char_size. | ||
| 37 | |||
| 1 | 2009-07-01 Kenichi Handa <handa@m17n.org> | 38 | 2009-07-01 Kenichi Handa <handa@m17n.org> |
| 2 | 39 | ||
| 3 | * keyboard.c (decode_keyboard_code): New function. | 40 | * keyboard.c (decode_keyboard_code): New function. |
diff --git a/src/emacs.c b/src/emacs.c index e6af0974c2a..7e9373d305c 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -321,6 +321,7 @@ Display options:\n\ | |||
| 321 | --fullheight, -fh make the first frame high as the screen\n\ | 321 | --fullheight, -fh make the first frame high as the screen\n\ |
| 322 | --fullscreen, -fs make first frame fullscreen\n\ | 322 | --fullscreen, -fs make first frame fullscreen\n\ |
| 323 | --fullwidth, -fw make the first frame wide as the screen\n\ | 323 | --fullwidth, -fw make the first frame wide as the screen\n\ |
| 324 | --maximized, -mm make the first frame maximized\n\ | ||
| 324 | --geometry, -g GEOMETRY window geometry\n\ | 325 | --geometry, -g GEOMETRY window geometry\n\ |
| 325 | --no-bitmap-icon, -nbi do not use picture of gnu for Emacs icon\n\ | 326 | --no-bitmap-icon, -nbi do not use picture of gnu for Emacs icon\n\ |
| 326 | --iconic start Emacs in iconified state\n\ | 327 | --iconic start Emacs in iconified state\n\ |
| @@ -1917,6 +1918,7 @@ struct standard_args standard_args[] = | |||
| 1917 | { "-fs", "--fullscreen", 10, 0 }, | 1918 | { "-fs", "--fullscreen", 10, 0 }, |
| 1918 | { "-fw", "--fullwidth", 10, 0 }, | 1919 | { "-fw", "--fullwidth", 10, 0 }, |
| 1919 | { "-fh", "--fullheight", 10, 0 }, | 1920 | { "-fh", "--fullheight", 10, 0 }, |
| 1921 | { "-mm", "--maximized", 10, 0 }, | ||
| 1920 | { "-g", "--geometry", 10, 1 }, | 1922 | { "-g", "--geometry", 10, 1 }, |
| 1921 | { "-geometry", 0, 10, 1 }, | 1923 | { "-geometry", 0, 10, 1 }, |
| 1922 | { "-T", "--title", 10, 1 }, | 1924 | { "-T", "--title", 10, 1 }, |
diff --git a/src/frame.c b/src/frame.c index 9e05b1b8456..fa2807c150a 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -120,7 +120,7 @@ Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; | |||
| 120 | Lisp_Object Qtty_color_mode; | 120 | Lisp_Object Qtty_color_mode; |
| 121 | Lisp_Object Qtty, Qtty_type; | 121 | Lisp_Object Qtty, Qtty_type; |
| 122 | 122 | ||
| 123 | Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; | 123 | Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth, Qmaximized; |
| 124 | Lisp_Object Qfont_backend; | 124 | Lisp_Object Qfont_backend; |
| 125 | Lisp_Object Qalpha; | 125 | Lisp_Object Qalpha; |
| 126 | 126 | ||
| @@ -2930,11 +2930,7 @@ x_set_frame_parameters (f, alist) | |||
| 2930 | int i, p; | 2930 | int i, p; |
| 2931 | int left_no_change = 0, top_no_change = 0; | 2931 | int left_no_change = 0, top_no_change = 0; |
| 2932 | int icon_left_no_change = 0, icon_top_no_change = 0; | 2932 | int icon_left_no_change = 0, icon_top_no_change = 0; |
| 2933 | int fullscreen_is_being_set = 0; | 2933 | int size_changed = 0; |
| 2934 | int height_for_full_width = 0; | ||
| 2935 | int width_for_full_height = 0; | ||
| 2936 | enum fullscreen_type fullscreen_wanted = FULLSCREEN_NONE; | ||
| 2937 | |||
| 2938 | struct gcpro gcpro1, gcpro2; | 2934 | struct gcpro gcpro1, gcpro2; |
| 2939 | 2935 | ||
| 2940 | i = 0; | 2936 | i = 0; |
| @@ -2976,7 +2972,6 @@ x_set_frame_parameters (f, alist) | |||
| 2976 | They are independent of other properties, but other properties (e.g., | 2972 | They are independent of other properties, but other properties (e.g., |
| 2977 | cursor_color) are dependent upon them. */ | 2973 | cursor_color) are dependent upon them. */ |
| 2978 | /* Process default font as well, since fringe widths depends on it. */ | 2974 | /* Process default font as well, since fringe widths depends on it. */ |
| 2979 | /* Also, process fullscreen, width and height depend upon that. */ | ||
| 2980 | for (p = 0; p < i; p++) | 2975 | for (p = 0; p < i; p++) |
| 2981 | { | 2976 | { |
| 2982 | Lisp_Object prop, val; | 2977 | Lisp_Object prop, val; |
| @@ -2985,26 +2980,11 @@ x_set_frame_parameters (f, alist) | |||
| 2985 | val = values[p]; | 2980 | val = values[p]; |
| 2986 | if (EQ (prop, Qforeground_color) | 2981 | if (EQ (prop, Qforeground_color) |
| 2987 | || EQ (prop, Qbackground_color) | 2982 | || EQ (prop, Qbackground_color) |
| 2988 | || EQ (prop, Qfont) | 2983 | || EQ (prop, Qfont)) |
| 2989 | || EQ (prop, Qfullscreen)) | ||
| 2990 | { | 2984 | { |
| 2991 | register Lisp_Object param_index, old_value; | 2985 | register Lisp_Object param_index, old_value; |
| 2992 | 2986 | ||
| 2993 | if (EQ (prop, Qfullscreen)) | ||
| 2994 | { | ||
| 2995 | /* The parameter handler can reset f->want_fullscreen to | ||
| 2996 | FULLSCREEN_NONE. But we need the requested value later | ||
| 2997 | to decide whether a height or width parameter shall be | ||
| 2998 | applied. Therefore, we remember the requested value in | ||
| 2999 | fullscreen_wanted for the following two cases. */ | ||
| 3000 | if (EQ (val, Qfullheight)) | ||
| 3001 | fullscreen_wanted = FULLSCREEN_HEIGHT; | ||
| 3002 | else if (EQ (val, Qfullwidth)) | ||
| 3003 | fullscreen_wanted = FULLSCREEN_WIDTH; | ||
| 3004 | } | ||
| 3005 | |||
| 3006 | old_value = get_frame_param (f, prop); | 2987 | old_value = get_frame_param (f, prop); |
| 3007 | fullscreen_is_being_set |= EQ (prop, Qfullscreen); | ||
| 3008 | if (NILP (Fequal (val, old_value))) | 2988 | if (NILP (Fequal (val, old_value))) |
| 3009 | { | 2989 | { |
| 3010 | store_frame_param (f, prop, val); | 2990 | store_frame_param (f, prop, val); |
| @@ -3028,9 +3008,15 @@ x_set_frame_parameters (f, alist) | |||
| 3028 | val = values[i]; | 3008 | val = values[i]; |
| 3029 | 3009 | ||
| 3030 | if (EQ (prop, Qwidth) && NATNUMP (val)) | 3010 | if (EQ (prop, Qwidth) && NATNUMP (val)) |
| 3031 | width_for_full_height = width = XFASTINT (val); | 3011 | { |
| 3012 | size_changed = 1; | ||
| 3013 | width = XFASTINT (val); | ||
| 3014 | } | ||
| 3032 | else if (EQ (prop, Qheight) && NATNUMP (val)) | 3015 | else if (EQ (prop, Qheight) && NATNUMP (val)) |
| 3033 | height_for_full_width = height = XFASTINT (val); | 3016 | { |
| 3017 | size_changed = 1; | ||
| 3018 | height = XFASTINT (val); | ||
| 3019 | } | ||
| 3034 | else if (EQ (prop, Qtop)) | 3020 | else if (EQ (prop, Qtop)) |
| 3035 | top = val; | 3021 | top = val; |
| 3036 | else if (EQ (prop, Qleft)) | 3022 | else if (EQ (prop, Qleft)) |
| @@ -3041,8 +3027,7 @@ x_set_frame_parameters (f, alist) | |||
| 3041 | icon_left = val; | 3027 | icon_left = val; |
| 3042 | else if (EQ (prop, Qforeground_color) | 3028 | else if (EQ (prop, Qforeground_color) |
| 3043 | || EQ (prop, Qbackground_color) | 3029 | || EQ (prop, Qbackground_color) |
| 3044 | || EQ (prop, Qfont) | 3030 | || EQ (prop, Qfont)) |
| 3045 | || EQ (prop, Qfullscreen)) | ||
| 3046 | /* Processed above. */ | 3031 | /* Processed above. */ |
| 3047 | continue; | 3032 | continue; |
| 3048 | else | 3033 | else |
| @@ -3096,31 +3081,6 @@ x_set_frame_parameters (f, alist) | |||
| 3096 | XSETINT (icon_top, 0); | 3081 | XSETINT (icon_top, 0); |
| 3097 | } | 3082 | } |
| 3098 | 3083 | ||
| 3099 | if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set) | ||
| 3100 | { | ||
| 3101 | /* If the frame is visible already and the fullscreen parameter is | ||
| 3102 | being set, it is too late to set WM manager hints to specify | ||
| 3103 | size and position. | ||
| 3104 | Here we first get the width, height and position that applies to | ||
| 3105 | fullscreen. We then move the frame to the appropriate | ||
| 3106 | position. Resize of the frame is taken care of in the code after | ||
| 3107 | this if-statement. */ | ||
| 3108 | int new_left, new_top; | ||
| 3109 | |||
| 3110 | x_fullscreen_adjust (f, &width, &height, &new_top, &new_left); | ||
| 3111 | if (new_top != f->top_pos || new_left != f->left_pos) | ||
| 3112 | x_set_offset (f, new_left, new_top, 1); | ||
| 3113 | |||
| 3114 | /* When both height and fullwidth were requested, make sure the | ||
| 3115 | requested value for height gets applied. */ | ||
| 3116 | if (height_for_full_width && fullscreen_wanted == FULLSCREEN_WIDTH) | ||
| 3117 | height = height_for_full_width; | ||
| 3118 | /* When both width and fullheight were requested, make sure the | ||
| 3119 | requested value for width gets applied. */ | ||
| 3120 | if (width_for_full_height && fullscreen_wanted == FULLSCREEN_HEIGHT) | ||
| 3121 | width = width_for_full_height; | ||
| 3122 | } | ||
| 3123 | |||
| 3124 | /* Don't set these parameters unless they've been explicitly | 3084 | /* Don't set these parameters unless they've been explicitly |
| 3125 | specified. The window might be mapped or resized while we're in | 3085 | specified. The window might be mapped or resized while we're in |
| 3126 | this function, and we don't want to override that unless the lisp | 3086 | this function, and we don't want to override that unless the lisp |
| @@ -3136,10 +3096,11 @@ x_set_frame_parameters (f, alist) | |||
| 3136 | 3096 | ||
| 3137 | XSETFRAME (frame, f); | 3097 | XSETFRAME (frame, f); |
| 3138 | 3098 | ||
| 3139 | if (width != FRAME_COLS (f) | 3099 | if (size_changed |
| 3140 | || height != FRAME_LINES (f) | 3100 | && (width != FRAME_COLS (f) |
| 3141 | || f->new_text_lines || f->new_text_cols) | 3101 | || height != FRAME_LINES (f) |
| 3142 | Fset_frame_size (frame, make_number (width), make_number (height)); | 3102 | || f->new_text_lines || f->new_text_cols)) |
| 3103 | Fset_frame_size (frame, make_number (width), make_number (height)); | ||
| 3143 | 3104 | ||
| 3144 | if ((!NILP (left) || !NILP (top)) | 3105 | if ((!NILP (left) || !NILP (top)) |
| 3145 | && ! (left_no_change && top_no_change) | 3106 | && ! (left_no_change && top_no_change) |
| @@ -3299,12 +3260,14 @@ x_set_fullscreen (f, new_value, old_value) | |||
| 3299 | { | 3260 | { |
| 3300 | if (NILP (new_value)) | 3261 | if (NILP (new_value)) |
| 3301 | f->want_fullscreen = FULLSCREEN_NONE; | 3262 | f->want_fullscreen = FULLSCREEN_NONE; |
| 3302 | else if (EQ (new_value, Qfullboth)) | 3263 | else if (EQ (new_value, Qfullboth) || EQ (new_value, Qfullscreen)) |
| 3303 | f->want_fullscreen = FULLSCREEN_BOTH; | 3264 | f->want_fullscreen = FULLSCREEN_BOTH; |
| 3304 | else if (EQ (new_value, Qfullwidth)) | 3265 | else if (EQ (new_value, Qfullwidth)) |
| 3305 | f->want_fullscreen = FULLSCREEN_WIDTH; | 3266 | f->want_fullscreen = FULLSCREEN_WIDTH; |
| 3306 | else if (EQ (new_value, Qfullheight)) | 3267 | else if (EQ (new_value, Qfullheight)) |
| 3307 | f->want_fullscreen = FULLSCREEN_HEIGHT; | 3268 | f->want_fullscreen = FULLSCREEN_HEIGHT; |
| 3269 | else if (EQ (new_value, Qmaximized)) | ||
| 3270 | f->want_fullscreen = FULLSCREEN_MAXIMIZED; | ||
| 3308 | 3271 | ||
| 3309 | if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) | 3272 | if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) |
| 3310 | FRAME_TERMINAL (f)->fullscreen_hook (f); | 3273 | FRAME_TERMINAL (f)->fullscreen_hook (f); |
| @@ -3443,19 +3406,6 @@ x_set_font (f, arg, oldval) | |||
| 3443 | if (CONSP (lval)) lval = CDR (lval); | 3406 | if (CONSP (lval)) lval = CDR (lval); |
| 3444 | 3407 | ||
| 3445 | x_new_font (f, font_object, fontset); | 3408 | x_new_font (f, font_object, fontset); |
| 3446 | /* If the fullscreen property is non-nil, adjust lines and columns so we | ||
| 3447 | keep the same pixel height and width. */ | ||
| 3448 | if (! NILP (lval)) | ||
| 3449 | { | ||
| 3450 | int height = FRAME_LINES (f), width = FRAME_COLS (f); | ||
| 3451 | if (EQ (lval, Qfullboth) || EQ (lval, Qfullwidth)) | ||
| 3452 | width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); | ||
| 3453 | if (EQ (lval, Qfullboth) || EQ (lval, Qfullheight)) | ||
| 3454 | height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f)); | ||
| 3455 | |||
| 3456 | change_frame_size (f, height, width, 0, 0, 1); | ||
| 3457 | } | ||
| 3458 | |||
| 3459 | store_frame_param (f, Qfont, arg); | 3409 | store_frame_param (f, Qfont, arg); |
| 3460 | /* Recalculate toolbar height. */ | 3410 | /* Recalculate toolbar height. */ |
| 3461 | f->n_tool_bar_rows = 0; | 3411 | f->n_tool_bar_rows = 0; |
| @@ -4374,22 +4324,6 @@ x_figure_window_size (f, parms, toolbar_p) | |||
| 4374 | window_prompting |= PPosition; | 4324 | window_prompting |= PPosition; |
| 4375 | } | 4325 | } |
| 4376 | 4326 | ||
| 4377 | if (f->want_fullscreen != FULLSCREEN_NONE) | ||
| 4378 | { | ||
| 4379 | int left, top; | ||
| 4380 | int width, height; | ||
| 4381 | |||
| 4382 | /* It takes both for some WM:s to place it where we want */ | ||
| 4383 | window_prompting |= USPosition | PPosition; | ||
| 4384 | x_fullscreen_adjust (f, &width, &height, &top, &left); | ||
| 4385 | FRAME_COLS (f) = width; | ||
| 4386 | FRAME_LINES (f) = height; | ||
| 4387 | FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); | ||
| 4388 | FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); | ||
| 4389 | f->left_pos = left; | ||
| 4390 | f->top_pos = top; | ||
| 4391 | } | ||
| 4392 | |||
| 4393 | if (window_prompting & XNegative) | 4327 | if (window_prompting & XNegative) |
| 4394 | { | 4328 | { |
| 4395 | if (window_prompting & YNegative) | 4329 | if (window_prompting & YNegative) |
| @@ -4503,6 +4437,8 @@ syms_of_frame () | |||
| 4503 | staticpro (&Qfullheight); | 4437 | staticpro (&Qfullheight); |
| 4504 | Qfullboth = intern ("fullboth"); | 4438 | Qfullboth = intern ("fullboth"); |
| 4505 | staticpro (&Qfullboth); | 4439 | staticpro (&Qfullboth); |
| 4440 | Qmaximized = intern ("maximized"); | ||
| 4441 | staticpro (&Qmaximized); | ||
| 4506 | Qx_resource_name = intern ("x-resource-name"); | 4442 | Qx_resource_name = intern ("x-resource-name"); |
| 4507 | staticpro (&Qx_resource_name); | 4443 | staticpro (&Qx_resource_name); |
| 4508 | 4444 | ||
diff --git a/src/frame.h b/src/frame.h index 9193da3edf3..808859e6612 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -75,12 +75,12 @@ enum text_cursor_kinds | |||
| 75 | 75 | ||
| 76 | enum fullscreen_type | 76 | enum fullscreen_type |
| 77 | { | 77 | { |
| 78 | /* Values used as a bit mask, BOTH == WIDTH | HEIGHT. */ | 78 | FULLSCREEN_NONE, |
| 79 | FULLSCREEN_NONE = 0, | 79 | FULLSCREEN_WIDTH = 0x001, |
| 80 | FULLSCREEN_WIDTH = 1, | 80 | FULLSCREEN_HEIGHT = 0x002, |
| 81 | FULLSCREEN_HEIGHT = 2, | 81 | FULLSCREEN_BOTH = 0x003, |
| 82 | FULLSCREEN_BOTH = 3, | 82 | FULLSCREEN_MAXIMIZED = 0x013, |
| 83 | FULLSCREEN_WAIT = 4 | 83 | FULLSCREEN_WAIT = 0x100 |
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | 86 | ||
| @@ -1038,6 +1038,7 @@ extern Lisp_Object Qscreen_gamma; | |||
| 1038 | extern Lisp_Object Qline_spacing; | 1038 | extern Lisp_Object Qline_spacing; |
| 1039 | extern Lisp_Object Qwait_for_wm; | 1039 | extern Lisp_Object Qwait_for_wm; |
| 1040 | extern Lisp_Object Qfullscreen; | 1040 | extern Lisp_Object Qfullscreen; |
| 1041 | extern Lisp_Object Qfullwidth, Qfullheight, Qfullboth, Qmaximized; | ||
| 1041 | extern Lisp_Object Qfont_backend; | 1042 | extern Lisp_Object Qfont_backend; |
| 1042 | extern Lisp_Object Qalpha; | 1043 | extern Lisp_Object Qalpha; |
| 1043 | 1044 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 3ea7c14629a..1872aa74d39 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -308,7 +308,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) | |||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | static Lisp_Object | 310 | static Lisp_Object |
| 311 | file_for_image(image) | 311 | file_for_image (image) |
| 312 | Lisp_Object image; | 312 | Lisp_Object image; |
| 313 | { | 313 | { |
| 314 | Lisp_Object specified_file = Qnil; | 314 | Lisp_Object specified_file = Qnil; |
| @@ -655,48 +655,6 @@ xg_frame_resized (f, pixelwidth, pixelheight) | |||
| 655 | } | 655 | } |
| 656 | } | 656 | } |
| 657 | 657 | ||
| 658 | /* Process all pending events on the display for frame F. */ | ||
| 659 | |||
| 660 | static void | ||
| 661 | flush_and_sync (f) | ||
| 662 | FRAME_PTR f; | ||
| 663 | { | ||
| 664 | gdk_window_process_all_updates (); | ||
| 665 | x_sync (f); | ||
| 666 | while (gtk_events_pending ()) | ||
| 667 | { | ||
| 668 | gtk_main_iteration (); | ||
| 669 | gdk_window_process_all_updates (); | ||
| 670 | x_sync (f); | ||
| 671 | } | ||
| 672 | } | ||
| 673 | |||
| 674 | /* Turn wm hints for resize off on frame F */ | ||
| 675 | |||
| 676 | static void | ||
| 677 | x_wm_size_hint_off (f) | ||
| 678 | FRAME_PTR f; | ||
| 679 | { | ||
| 680 | GdkGeometry size_hints; | ||
| 681 | gint hint_flags = 0; | ||
| 682 | memset (&size_hints, 0, sizeof (size_hints)); | ||
| 683 | hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE; | ||
| 684 | size_hints.width_inc = 1; | ||
| 685 | size_hints.height_inc = 1; | ||
| 686 | hint_flags |= GDK_HINT_BASE_SIZE; | ||
| 687 | size_hints.base_width = 1; | ||
| 688 | size_hints.base_height = 1; | ||
| 689 | size_hints.min_width = 1; | ||
| 690 | size_hints.min_height = 1; | ||
| 691 | gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | ||
| 692 | NULL, | ||
| 693 | &size_hints, | ||
| 694 | hint_flags); | ||
| 695 | /* Make sure these get set again in next call to x_wm_set_size_hint. */ | ||
| 696 | f->output_data.x->hint_flags &= ~hint_flags; | ||
| 697 | flush_and_sync (f); | ||
| 698 | } | ||
| 699 | |||
| 700 | /* Resize the outer window of frame F after chainging the height. | 658 | /* Resize the outer window of frame F after chainging the height. |
| 701 | This happend when the menu bar or the tool bar is added or removed. | 659 | This happend when the menu bar or the tool bar is added or removed. |
| 702 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ | 660 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ |
| @@ -729,13 +687,10 @@ xg_frame_set_char_size (f, cols, rows) | |||
| 729 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); | 687 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); |
| 730 | 688 | ||
| 731 | /* Must resize our top level widget. Font size may have changed, | 689 | /* Must resize our top level widget. Font size may have changed, |
| 732 | but not rows/cols. | 690 | but not rows/cols. */ |
| 733 | Turn wm hints (min/max size and size increments) of temporarly. | ||
| 734 | It interferes too much, when for example adding or removing the | ||
| 735 | menu/tool bar. */ | ||
| 736 | x_wm_size_hint_off (f); | ||
| 737 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 691 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 738 | pixelwidth, pixelheight); | 692 | pixelwidth, pixelheight); |
| 693 | x_wm_set_size_hint (f, 0, 0); | ||
| 739 | 694 | ||
| 740 | /* Now, strictly speaking, we can't be sure that this is accurate, | 695 | /* Now, strictly speaking, we can't be sure that this is accurate, |
| 741 | but the window manager will get around to dealing with the size | 696 | but the window manager will get around to dealing with the size |
| @@ -759,7 +714,18 @@ xg_frame_set_char_size (f, cols, rows) | |||
| 759 | for, then the event won't cause the screen to become garbaged, so | 714 | for, then the event won't cause the screen to become garbaged, so |
| 760 | we have to make sure to do it here. */ | 715 | we have to make sure to do it here. */ |
| 761 | SET_FRAME_GARBAGED (f); | 716 | SET_FRAME_GARBAGED (f); |
| 762 | flush_and_sync (f); | 717 | } |
| 718 | |||
| 719 | /* Handle height changes (i.e. add/remove menu/toolbar). | ||
| 720 | The policy is to keep the number of editable lines. */ | ||
| 721 | |||
| 722 | static void | ||
| 723 | xg_height_changed (f) | ||
| 724 | FRAME_PTR f; | ||
| 725 | { | ||
| 726 | gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | ||
| 727 | FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f)); | ||
| 728 | f->output_data.x->hint_flags = 0; | ||
| 763 | x_wm_set_size_hint (f, 0, 0); | 729 | x_wm_set_size_hint (f, 0, 0); |
| 764 | } | 730 | } |
| 765 | 731 | ||
| @@ -859,9 +825,6 @@ xg_create_frame_widgets (f) | |||
| 859 | 825 | ||
| 860 | gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE); | 826 | gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE); |
| 861 | 827 | ||
| 862 | gtk_widget_set_size_request (wfixed, FRAME_PIXEL_WIDTH (f), | ||
| 863 | FRAME_PIXEL_HEIGHT (f)); | ||
| 864 | |||
| 865 | gtk_container_add (GTK_CONTAINER (wtop), wvbox); | 828 | gtk_container_add (GTK_CONTAINER (wtop), wvbox); |
| 866 | gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0); | 829 | gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0); |
| 867 | 830 | ||
| @@ -875,9 +838,6 @@ xg_create_frame_widgets (f) | |||
| 875 | a lot, so we turn off double buffering. */ | 838 | a lot, so we turn off double buffering. */ |
| 876 | gtk_widget_set_double_buffered (wfixed, FALSE); | 839 | gtk_widget_set_double_buffered (wfixed, FALSE); |
| 877 | 840 | ||
| 878 | /* GTK documents says use gtk_window_set_resizable. But then a user | ||
| 879 | can't shrink the window from its starting size. */ | ||
| 880 | gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE); | ||
| 881 | gtk_window_set_wmclass (GTK_WINDOW (wtop), | 841 | gtk_window_set_wmclass (GTK_WINDOW (wtop), |
| 882 | SSDATA (Vx_resource_name), | 842 | SSDATA (Vx_resource_name), |
| 883 | SSDATA (Vx_resource_class)); | 843 | SSDATA (Vx_resource_class)); |
| @@ -891,6 +851,8 @@ xg_create_frame_widgets (f) | |||
| 891 | and specify it. | 851 | and specify it. |
| 892 | GTK will itself handle calculating the real position this way. */ | 852 | GTK will itself handle calculating the real position this way. */ |
| 893 | xg_set_geometry (f); | 853 | xg_set_geometry (f); |
| 854 | int grav = gtk_window_get_gravity (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f))); | ||
| 855 | f->win_gravity = grav; | ||
| 894 | 856 | ||
| 895 | gtk_widget_add_events (wfixed, | 857 | gtk_widget_add_events (wfixed, |
| 896 | GDK_POINTER_MOTION_MASK | 858 | GDK_POINTER_MOTION_MASK |
| @@ -2987,14 +2949,8 @@ xg_update_frame_menubar (f) | |||
| 2987 | 2949 | ||
| 2988 | gtk_widget_show_all (x->menubar_widget); | 2950 | gtk_widget_show_all (x->menubar_widget); |
| 2989 | gtk_widget_size_request (x->menubar_widget, &req); | 2951 | gtk_widget_size_request (x->menubar_widget, &req); |
| 2990 | |||
| 2991 | FRAME_MENUBAR_HEIGHT (f) = req.height; | 2952 | FRAME_MENUBAR_HEIGHT (f) = req.height; |
| 2992 | 2953 | xg_height_changed (f); | |
| 2993 | /* The height has changed, resize outer widget and set columns | ||
| 2994 | rows to what we had before adding the menu bar. */ | ||
| 2995 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 2996 | |||
| 2997 | SET_FRAME_GARBAGED (f); | ||
| 2998 | UNBLOCK_INPUT; | 2954 | UNBLOCK_INPUT; |
| 2999 | 2955 | ||
| 3000 | return 1; | 2956 | return 1; |
| @@ -3018,12 +2974,7 @@ free_frame_menubar (f) | |||
| 3018 | the container. */ | 2974 | the container. */ |
| 3019 | x->menubar_widget = 0; | 2975 | x->menubar_widget = 0; |
| 3020 | FRAME_MENUBAR_HEIGHT (f) = 0; | 2976 | FRAME_MENUBAR_HEIGHT (f) = 0; |
| 3021 | 2977 | xg_height_changed (f); | |
| 3022 | /* The height has changed, resize outer widget and set columns | ||
| 3023 | rows to what we had before removing the menu bar. */ | ||
| 3024 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 3025 | |||
| 3026 | SET_FRAME_GARBAGED (f); | ||
| 3027 | UNBLOCK_INPUT; | 2978 | UNBLOCK_INPUT; |
| 3028 | } | 2979 | } |
| 3029 | } | 2980 | } |
| @@ -3627,11 +3578,8 @@ xg_tool_bar_detach_callback (wbox, w, client_data) | |||
| 3627 | /* When detaching a tool bar, not everything dissapear. There are | 3578 | /* When detaching a tool bar, not everything dissapear. There are |
| 3628 | a few pixels left that are used to drop the tool bar back into | 3579 | a few pixels left that are used to drop the tool bar back into |
| 3629 | place. */ | 3580 | place. */ |
| 3630 | FRAME_TOOLBAR_HEIGHT (f) = 2; | 3581 | FRAME_TOOLBAR_HEIGHT (f) = 4; |
| 3631 | 3582 | xg_height_changed (f); | |
| 3632 | /* The height has changed, resize outer widget and set columns | ||
| 3633 | rows to what we had before detaching the tool bar. */ | ||
| 3634 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 3635 | } | 3583 | } |
| 3636 | } | 3584 | } |
| 3637 | 3585 | ||
| @@ -3659,10 +3607,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data) | |||
| 3659 | 3607 | ||
| 3660 | gtk_widget_size_request (w, &req); | 3608 | gtk_widget_size_request (w, &req); |
| 3661 | FRAME_TOOLBAR_HEIGHT (f) = req.height; | 3609 | FRAME_TOOLBAR_HEIGHT (f) = req.height; |
| 3662 | 3610 | xg_height_changed (f); | |
| 3663 | /* The height has changed, resize outer widget and set columns | ||
| 3664 | rows to what we had before attaching the tool bar. */ | ||
| 3665 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 3666 | } | 3611 | } |
| 3667 | } | 3612 | } |
| 3668 | 3613 | ||
| @@ -4149,20 +4094,17 @@ update_frame_tool_bar (f) | |||
| 4149 | } while (ti != NULL); | 4094 | } while (ti != NULL); |
| 4150 | 4095 | ||
| 4151 | new_req.height = 0; | 4096 | new_req.height = 0; |
| 4152 | gtk_widget_size_request (GTK_WIDGET (wtoolbar), &new_req); | ||
| 4153 | |||
| 4154 | if (pack_tool_bar && f->n_tool_bar_items != 0) | 4097 | if (pack_tool_bar && f->n_tool_bar_items != 0) |
| 4155 | xg_pack_tool_bar (f); | 4098 | xg_pack_tool_bar (f); |
| 4099 | |||
| 4156 | 4100 | ||
| 4157 | if (new_req.height != 0 | 4101 | gtk_widget_size_request (GTK_WIDGET (x->toolbar_widget), &new_req); |
| 4158 | && f->n_tool_bar_items != 0 | 4102 | if (old_req.height != new_req.height |
| 4159 | && old_req.height != new_req.height | ||
| 4160 | && ! FRAME_X_OUTPUT (f)->toolbar_detached) | 4103 | && ! FRAME_X_OUTPUT (f)->toolbar_detached) |
| 4161 | { | 4104 | { |
| 4162 | FRAME_TOOLBAR_HEIGHT (f) = new_req.height; | 4105 | FRAME_TOOLBAR_HEIGHT (f) = new_req.height; |
| 4163 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | 4106 | xg_height_changed (f); |
| 4164 | } | 4107 | } |
| 4165 | |||
| 4166 | UNBLOCK_INPUT; | 4108 | UNBLOCK_INPUT; |
| 4167 | } | 4109 | } |
| 4168 | 4110 | ||
| @@ -4190,10 +4132,8 @@ free_frame_tool_bar (f) | |||
| 4190 | x->toolbar_widget = 0; | 4132 | x->toolbar_widget = 0; |
| 4191 | x->handlebox_widget = 0; | 4133 | x->handlebox_widget = 0; |
| 4192 | FRAME_TOOLBAR_HEIGHT (f) = 0; | 4134 | FRAME_TOOLBAR_HEIGHT (f) = 0; |
| 4135 | xg_height_changed (f); | ||
| 4193 | 4136 | ||
| 4194 | /* The height has changed, resize outer widget and set columns | ||
| 4195 | rows to what we had before removing the tool bar. */ | ||
| 4196 | xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f)); | ||
| 4197 | UNBLOCK_INPUT; | 4137 | UNBLOCK_INPUT; |
| 4198 | } | 4138 | } |
| 4199 | } | 4139 | } |
diff --git a/src/xterm.c b/src/xterm.c index f0b4c2e983a..32ee1596679 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6059,8 +6059,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6059 | f = x_window_to_frame (dpyinfo, event.xexpose.window); | 6059 | f = x_window_to_frame (dpyinfo, event.xexpose.window); |
| 6060 | if (f) | 6060 | if (f) |
| 6061 | { | 6061 | { |
| 6062 | x_check_fullscreen (f); | ||
| 6063 | |||
| 6064 | #ifdef USE_GTK | 6062 | #ifdef USE_GTK |
| 6065 | /* This seems to be needed for GTK 2.6. */ | 6063 | /* This seems to be needed for GTK 2.6. */ |
| 6066 | x_clear_area (event.xexpose.display, | 6064 | x_clear_area (event.xexpose.display, |
| @@ -6205,6 +6203,9 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6205 | to update the frame titles | 6203 | to update the frame titles |
| 6206 | in case this is the second frame. */ | 6204 | in case this is the second frame. */ |
| 6207 | record_asynch_buffer_change (); | 6205 | record_asynch_buffer_change (); |
| 6206 | |||
| 6207 | /* Check if fullscreen was specified before we where mapped. */ | ||
| 6208 | x_check_fullscreen (f); | ||
| 6208 | } | 6209 | } |
| 6209 | goto OTHER; | 6210 | goto OTHER; |
| 6210 | 6211 | ||
| @@ -6705,19 +6706,9 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6705 | { | 6706 | { |
| 6706 | #ifndef USE_X_TOOLKIT | 6707 | #ifndef USE_X_TOOLKIT |
| 6707 | #ifndef USE_GTK | 6708 | #ifndef USE_GTK |
| 6708 | /* If there is a pending resize for fullscreen, don't | ||
| 6709 | do this one, the right one will come later. | ||
| 6710 | The toolkit version doesn't seem to need this, but we | ||
| 6711 | need to reset it below. */ | ||
| 6712 | int dont_resize | ||
| 6713 | = ((f->want_fullscreen & FULLSCREEN_WAIT) | ||
| 6714 | && f->new_text_cols != 0); | ||
| 6715 | int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, event.xconfigure.height); | 6709 | int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, event.xconfigure.height); |
| 6716 | int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, event.xconfigure.width); | 6710 | int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, event.xconfigure.width); |
| 6717 | 6711 | ||
| 6718 | if (dont_resize) | ||
| 6719 | goto OTHER; | ||
| 6720 | |||
| 6721 | /* In the toolkit version, change_frame_size | 6712 | /* In the toolkit version, change_frame_size |
| 6722 | is called by the code that handles resizing | 6713 | is called by the code that handles resizing |
| 6723 | of the EmacsFrame widget. */ | 6714 | of the EmacsFrame widget. */ |
| @@ -6748,9 +6739,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6748 | #endif | 6739 | #endif |
| 6749 | { | 6740 | { |
| 6750 | x_real_positions (f, &f->left_pos, &f->top_pos); | 6741 | x_real_positions (f, &f->left_pos, &f->top_pos); |
| 6751 | |||
| 6752 | if (f->want_fullscreen & FULLSCREEN_WAIT) | ||
| 6753 | f->want_fullscreen &= ~(FULLSCREEN_WAIT|FULLSCREEN_BOTH); | ||
| 6754 | } | 6742 | } |
| 6755 | 6743 | ||
| 6756 | #ifdef HAVE_X_I18N | 6744 | #ifdef HAVE_X_I18N |
| @@ -6758,6 +6746,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6758 | xic_set_statusarea (f); | 6746 | xic_set_statusarea (f); |
| 6759 | #endif | 6747 | #endif |
| 6760 | 6748 | ||
| 6749 | #ifndef USE_GTK | ||
| 6761 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | 6750 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
| 6762 | { | 6751 | { |
| 6763 | /* Since the WM decorations come below top_pos now, | 6752 | /* Since the WM decorations come below top_pos now, |
| @@ -6765,6 +6754,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6765 | f->win_gravity = NorthWestGravity; | 6754 | f->win_gravity = NorthWestGravity; |
| 6766 | x_wm_set_size_hint (f, (long) 0, 0); | 6755 | x_wm_set_size_hint (f, (long) 0, 0); |
| 6767 | } | 6756 | } |
| 6757 | #endif | ||
| 6768 | } | 6758 | } |
| 6769 | goto OTHER; | 6759 | goto OTHER; |
| 6770 | 6760 | ||
| @@ -8444,6 +8434,28 @@ wm_supports (f, atomname) | |||
| 8444 | return rc; | 8434 | return rc; |
| 8445 | } | 8435 | } |
| 8446 | 8436 | ||
| 8437 | static void | ||
| 8438 | set_wm_state (frame, add, what, what2) | ||
| 8439 | Lisp_Object frame; | ||
| 8440 | int add; | ||
| 8441 | const char *what; | ||
| 8442 | const char *what2; | ||
| 8443 | { | ||
| 8444 | const char *atom = "_NET_WM_STATE"; | ||
| 8445 | Fx_send_client_event (frame, make_number (0), frame, | ||
| 8446 | make_unibyte_string (atom, strlen (atom)), | ||
| 8447 | make_number (32), | ||
| 8448 | /* 1 = add, 0 = remove */ | ||
| 8449 | Fcons | ||
| 8450 | (make_number (add ? 1 : 0), | ||
| 8451 | Fcons | ||
| 8452 | (make_unibyte_string (what, strlen (what)), | ||
| 8453 | what2 != 0 | ||
| 8454 | ? Fcons (make_unibyte_string (what2, strlen (what2)), | ||
| 8455 | Qnil) | ||
| 8456 | : Qnil))); | ||
| 8457 | } | ||
| 8458 | |||
| 8447 | /* Do fullscreen as specified in extended window manager hints */ | 8459 | /* Do fullscreen as specified in extended window manager hints */ |
| 8448 | 8460 | ||
| 8449 | static int | 8461 | static int |
| @@ -8460,66 +8472,36 @@ do_ewmh_fullscreen (f) | |||
| 8460 | if (have_net_atom) | 8472 | if (have_net_atom) |
| 8461 | { | 8473 | { |
| 8462 | Lisp_Object frame; | 8474 | Lisp_Object frame; |
| 8463 | const char *atom = "_NET_WM_STATE"; | ||
| 8464 | const char *fs = "_NET_WM_STATE_FULLSCREEN"; | 8475 | const char *fs = "_NET_WM_STATE_FULLSCREEN"; |
| 8465 | const char *fw = "_NET_WM_STATE_MAXIMIZED_HORZ"; | 8476 | const char *fw = "_NET_WM_STATE_MAXIMIZED_HORZ"; |
| 8466 | const char *fh = "_NET_WM_STATE_MAXIMIZED_VERT"; | 8477 | const char *fh = "_NET_WM_STATE_MAXIMIZED_VERT"; |
| 8467 | const char *what = NULL; | ||
| 8468 | 8478 | ||
| 8469 | XSETFRAME (frame, f); | 8479 | XSETFRAME (frame, f); |
| 8470 | 8480 | ||
| 8481 | set_wm_state (frame, 0, fs, NULL); | ||
| 8482 | set_wm_state (frame, 0, fh, NULL); | ||
| 8483 | set_wm_state (frame, 0, fw, NULL); | ||
| 8484 | |||
| 8471 | /* If there are _NET_ atoms we assume we have extended window manager | 8485 | /* If there are _NET_ atoms we assume we have extended window manager |
| 8472 | hints. */ | 8486 | hints. */ |
| 8473 | switch (f->want_fullscreen) | 8487 | switch (f->want_fullscreen) |
| 8474 | { | 8488 | { |
| 8475 | case FULLSCREEN_BOTH: | 8489 | case FULLSCREEN_BOTH: |
| 8476 | what = fs; | 8490 | set_wm_state (frame, 1, fs, NULL); |
| 8477 | break; | 8491 | break; |
| 8478 | case FULLSCREEN_WIDTH: | 8492 | case FULLSCREEN_WIDTH: |
| 8479 | what = fw; | 8493 | set_wm_state (frame, 1, fw, NULL); |
| 8480 | break; | 8494 | break; |
| 8481 | case FULLSCREEN_HEIGHT: | 8495 | case FULLSCREEN_HEIGHT: |
| 8482 | what = fh; | 8496 | set_wm_state (frame, 1, fh, NULL); |
| 8497 | break; | ||
| 8498 | case FULLSCREEN_MAXIMIZED: | ||
| 8499 | set_wm_state (frame, 1, fw, fh); | ||
| 8483 | break; | 8500 | break; |
| 8484 | } | 8501 | } |
| 8485 | 8502 | ||
| 8486 | if (what != NULL && !wm_supports (f, what)) return 0; | ||
| 8487 | |||
| 8488 | |||
| 8489 | Fx_send_client_event (frame, make_number (0), frame, | ||
| 8490 | make_unibyte_string (atom, strlen (atom)), | ||
| 8491 | make_number (32), | ||
| 8492 | Fcons (make_number (0), /* Remove */ | ||
| 8493 | Fcons | ||
| 8494 | (make_unibyte_string (fs, | ||
| 8495 | strlen (fs)), | ||
| 8496 | Qnil))); | ||
| 8497 | Fx_send_client_event (frame, make_number (0), frame, | ||
| 8498 | make_unibyte_string (atom, strlen (atom)), | ||
| 8499 | make_number (32), | ||
| 8500 | Fcons (make_number (0), /* Remove */ | ||
| 8501 | Fcons | ||
| 8502 | (make_unibyte_string (fh, | ||
| 8503 | strlen (fh)), | ||
| 8504 | Qnil))); | ||
| 8505 | Fx_send_client_event (frame, make_number (0), frame, | ||
| 8506 | make_unibyte_string (atom, strlen (atom)), | ||
| 8507 | make_number (32), | ||
| 8508 | Fcons (make_number (0), /* Remove */ | ||
| 8509 | Fcons | ||
| 8510 | (make_unibyte_string (fw, | ||
| 8511 | strlen (fw)), | ||
| 8512 | Qnil))); | ||
| 8513 | f->want_fullscreen = FULLSCREEN_NONE; | 8503 | f->want_fullscreen = FULLSCREEN_NONE; |
| 8514 | if (what != NULL) | 8504 | |
| 8515 | Fx_send_client_event (frame, make_number (0), frame, | ||
| 8516 | make_unibyte_string (atom, strlen (atom)), | ||
| 8517 | make_number (32), | ||
| 8518 | Fcons (make_number (1), /* Add */ | ||
| 8519 | Fcons | ||
| 8520 | (make_unibyte_string (what, | ||
| 8521 | strlen (what)), | ||
| 8522 | Qnil))); | ||
| 8523 | } | 8505 | } |
| 8524 | 8506 | ||
| 8525 | return have_net_atom; | 8507 | return have_net_atom; |
| @@ -8532,14 +8514,13 @@ XTfullscreen_hook (f) | |||
| 8532 | if (f->async_visible) | 8514 | if (f->async_visible) |
| 8533 | { | 8515 | { |
| 8534 | BLOCK_INPUT; | 8516 | BLOCK_INPUT; |
| 8535 | do_ewmh_fullscreen (f); | 8517 | x_check_fullscreen (f); |
| 8536 | x_sync (f); | 8518 | x_sync (f); |
| 8537 | UNBLOCK_INPUT; | 8519 | UNBLOCK_INPUT; |
| 8538 | } | 8520 | } |
| 8539 | } | 8521 | } |
| 8540 | 8522 | ||
| 8541 | 8523 | ||
| 8542 | extern Lisp_Object Qfullwidth, Qfullheight, Qfullboth; | ||
| 8543 | static void | 8524 | static void |
| 8544 | x_handle_net_wm_state (f, event) | 8525 | x_handle_net_wm_state (f, event) |
| 8545 | struct frame *f; | 8526 | struct frame *f; |
| @@ -8547,7 +8528,7 @@ x_handle_net_wm_state (f, event) | |||
| 8547 | { | 8528 | { |
| 8548 | Atom actual_type; | 8529 | Atom actual_type; |
| 8549 | unsigned long actual_size, bytes_remaining; | 8530 | unsigned long actual_size, bytes_remaining; |
| 8550 | int i, rc, actual_format, value = 0; | 8531 | int i, rc, actual_format, value = FULLSCREEN_NONE; |
| 8551 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 8532 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 8552 | long max_len = 65536; | 8533 | long max_len = 65536; |
| 8553 | Display *dpy = FRAME_X_DISPLAY (f); | 8534 | Display *dpy = FRAME_X_DISPLAY (f); |
| @@ -8575,12 +8556,22 @@ x_handle_net_wm_state (f, event) | |||
| 8575 | for (i = 0; i < actual_size; ++i) | 8556 | for (i = 0; i < actual_size; ++i) |
| 8576 | { | 8557 | { |
| 8577 | Atom a = ((Atom*)tmp_data)[i]; | 8558 | Atom a = ((Atom*)tmp_data)[i]; |
| 8578 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) | 8559 | if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) |
| 8579 | value |= FULLSCREEN_WIDTH; | 8560 | { |
| 8561 | if (value == FULLSCREEN_HEIGHT) | ||
| 8562 | value = FULLSCREEN_MAXIMIZED; | ||
| 8563 | else | ||
| 8564 | value = FULLSCREEN_WIDTH; | ||
| 8565 | } | ||
| 8580 | else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert) | 8566 | else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert) |
| 8581 | value |= FULLSCREEN_HEIGHT; | 8567 | { |
| 8568 | if (value == FULLSCREEN_WIDTH) | ||
| 8569 | value = FULLSCREEN_MAXIMIZED; | ||
| 8570 | else | ||
| 8571 | value = FULLSCREEN_HEIGHT; | ||
| 8572 | } | ||
| 8582 | else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom) | 8573 | else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom) |
| 8583 | value |= FULLSCREEN_BOTH; | 8574 | value = FULLSCREEN_BOTH; |
| 8584 | } | 8575 | } |
| 8585 | 8576 | ||
| 8586 | lval = Qnil; | 8577 | lval = Qnil; |
| @@ -8595,6 +8586,9 @@ x_handle_net_wm_state (f, event) | |||
| 8595 | case FULLSCREEN_BOTH: | 8586 | case FULLSCREEN_BOTH: |
| 8596 | lval = Qfullboth; | 8587 | lval = Qfullboth; |
| 8597 | break; | 8588 | break; |
| 8589 | case FULLSCREEN_MAXIMIZED: | ||
| 8590 | lval = Qmaximized; | ||
| 8591 | break; | ||
| 8598 | } | 8592 | } |
| 8599 | 8593 | ||
| 8600 | store_frame_param (f, Qfullscreen, lval); | 8594 | store_frame_param (f, Qfullscreen, lval); |
| @@ -8609,29 +8603,37 @@ static void | |||
| 8609 | x_check_fullscreen (f) | 8603 | x_check_fullscreen (f) |
| 8610 | struct frame *f; | 8604 | struct frame *f; |
| 8611 | { | 8605 | { |
| 8612 | if (f->want_fullscreen & FULLSCREEN_BOTH) | 8606 | if (do_ewmh_fullscreen (f)) |
| 8613 | { | 8607 | return; |
| 8614 | int width, height, ign; | ||
| 8615 | |||
| 8616 | if (do_ewmh_fullscreen (f)) | ||
| 8617 | return; | ||
| 8618 | 8608 | ||
| 8619 | x_real_positions (f, &f->left_pos, &f->top_pos); | 8609 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) |
| 8610 | return; // Only fullscreen without WM or with EWM hints (above). | ||
| 8620 | 8611 | ||
| 8621 | x_fullscreen_adjust (f, &width, &height, &ign, &ign); | 8612 | if (f->want_fullscreen != FULLSCREEN_NONE) |
| 8613 | { | ||
| 8614 | int width = FRAME_COLS (f), height = FRAME_LINES (f); | ||
| 8615 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | ||
| 8622 | 8616 | ||
| 8623 | /* We do not need to move the window, it shall be taken care of | 8617 | switch (f->want_fullscreen) |
| 8624 | when setting WM manager hints. | 8618 | { |
| 8625 | If the frame is visible already, the position is checked by | 8619 | /* No difference between these two when there is no WM */ |
| 8626 | x_check_expected_move. */ | 8620 | case FULLSCREEN_BOTH: |
| 8621 | case FULLSCREEN_MAXIMIZED: | ||
| 8622 | width = x_display_pixel_width (dpyinfo); | ||
| 8623 | height = x_display_pixel_height (dpyinfo); | ||
| 8624 | break; | ||
| 8625 | case FULLSCREEN_WIDTH: | ||
| 8626 | width = x_display_pixel_width (dpyinfo); | ||
| 8627 | break; | ||
| 8628 | case FULLSCREEN_HEIGHT: | ||
| 8629 | height = x_display_pixel_height (dpyinfo); | ||
| 8630 | } | ||
| 8631 | |||
| 8627 | if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) | 8632 | if (FRAME_COLS (f) != width || FRAME_LINES (f) != height) |
| 8628 | { | 8633 | { |
| 8629 | change_frame_size (f, height, width, 0, 1, 0); | 8634 | change_frame_size (f, height, width, 0, 1, 0); |
| 8630 | SET_FRAME_GARBAGED (f); | 8635 | SET_FRAME_GARBAGED (f); |
| 8631 | cancel_mouse_face (f); | 8636 | cancel_mouse_face (f); |
| 8632 | |||
| 8633 | /* Wait for the change of frame size to occur */ | ||
| 8634 | f->want_fullscreen |= FULLSCREEN_WAIT; | ||
| 8635 | } | 8637 | } |
| 8636 | } | 8638 | } |
| 8637 | } | 8639 | } |
| @@ -8658,7 +8660,7 @@ x_check_expected_move (f, expected_left, expected_top) | |||
| 8658 | x_real_positions (f, ¤t_left, ¤t_top); | 8660 | x_real_positions (f, ¤t_left, ¤t_top); |
| 8659 | 8661 | ||
| 8660 | if (current_left != expected_left || current_top != expected_top) | 8662 | if (current_left != expected_left || current_top != expected_top) |
| 8661 | { | 8663 | { |
| 8662 | /* It's a "Type A" window manager. */ | 8664 | /* It's a "Type A" window manager. */ |
| 8663 | 8665 | ||
| 8664 | int adjusted_left; | 8666 | int adjusted_left; |
| @@ -8677,7 +8679,7 @@ x_check_expected_move (f, expected_left, expected_top) | |||
| 8677 | adjusted_left, adjusted_top); | 8679 | adjusted_left, adjusted_top); |
| 8678 | 8680 | ||
| 8679 | x_sync_with_move (f, expected_left, expected_top, 0); | 8681 | x_sync_with_move (f, expected_left, expected_top, 0); |
| 8680 | } | 8682 | } |
| 8681 | else | 8683 | else |
| 8682 | /* It's a "Type B" window manager. We don't have to adjust the | 8684 | /* It's a "Type B" window manager. We don't have to adjust the |
| 8683 | frame's position. */ | 8685 | frame's position. */ |