Commit 3f1c6666 authored by Jan Djärv's avatar Jan Djärv

* emacs.c (USAGE3, standard_args): Add -mm and --maximized.

* frame.c: Qmaximized is new.
(x_set_frame_parameters): Do not handle fullscreen specially.
Only set width and height if explicitly set.
(x_set_fullscreen): Handle Qmaximized.
(x_set_font, x_figure_window_size): Do not handle fullscreen specially.
(syms_of_frame): Initialize Qmaximized.

* frame.h (fullscreen_type): Add FULLSCREEN_MAXIMIZED.  Declare
Qfullwidth, Qfullheight, Qfullboth, Qmaximized.

* xterm.c (handle_one_xevent): Remove call to x_check_fullscreen
for Expose event. Add call to x_check_fullscreen for MapNotify event.
Remove all code w.r.t. fullscreen from ConfigureNotify event. Do not
set gravity to NorthWestGravity when USE_GTK.
(set_wm_state): New function.
(do_ewmh_fullscreen): Use set_wm_state. Also handle FULLSCREEN_MAXIMIZED.
(x_handle_net_wm_state): Handle FULLSCREEN_MAXIMIZED.
(x_check_fullscreen): Simplify so we only handle EMWH type of fullscreen
or the case when no window manager is running. That means remove calls
to x_real_positions and x_fullscreen_adjust.

* gtkutil.c (flush_and_sync, x_wm_size_hint_off): Remove.
(xg_frame_set_char_size): Remove calls to x_wm_size_hint_off and
flush_and_sync.
(xg_height_changed): New function.
(xg_create_frame_widgets): Remove call to gtk_widget_set_size_request
and gtk_window_set_policy.  Set frame gravity after parsing the geometry
string.
(xg_update_frame_menubar, free_frame_menubar)
(xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
(update_frame_tool_bar, free_frame_tool_bar): Call xg_height_changed.
Remove calls to xg_frame_set_char_size.

* startup.el (command-line-x-option-alist): Add -mm and --maximized.

* NEWS: Mention maximized.

* frames.texi (Size Parameters): Mention maximized for fullscreen.

* xresources.texi (Table of Resources): Mention maximized for
fullscreen.

* cmdargs.texi (Window Size X): -mm/--maximized is new.
parent 62aadce7
2009-07-01 Jan Djärv <jan.h.d@swipnet.se>
* xresources.texi (Table of Resources): Mention maximized for
fullscreen.
* cmdargs.texi (Window Size X): -mm/--maximized is new.
2009-07-01 Chong Yidong <cyd@stupidchicken.com> 2009-07-01 Chong Yidong <cyd@stupidchicken.com>
* anti.texi (Antinews): Correct the list of removed platforms. * anti.texi (Antinews): Correct the list of removed platforms.
......
...@@ -1184,7 +1184,16 @@ the initial frame. ...@@ -1184,7 +1184,16 @@ the initial frame.
@itemx --fullscreen @itemx --fullscreen
@opindex --fullscreen @opindex --fullscreen
@cindex fullscreen, command-line argument @cindex fullscreen, command-line argument
Specify that width and height shall be the size of the screen. Specify that width and height shall be the size of the screen. Normally
no window manager decorations are shown.
@item -mm
@opindex -mm
@itemx --maximized
@opindex --maximized
@cindex maximized, command-line argument
Specify that the Emacs frame shall be maximized. This normally
means that the frame has window manager decorations.
@item -fh @item -fh
@opindex -fh @opindex -fh
...@@ -1258,8 +1267,8 @@ size with no tool bar, use an X resource to specify ``no tool bar'' ...@@ -1258,8 +1267,8 @@ size with no tool bar, use an X resource to specify ``no tool bar''
(@pxref{Table of Resources}); then Emacs will already know there's no (@pxref{Table of Resources}); then Emacs will already know there's no
tool bar when it processes the specified geometry. tool bar when it processes the specified geometry.
When using one of @samp{--fullscreen}, @samp{--fullwidth} or When using one of @samp{--fullscreen}, @samp{--maximized}, @samp{--fullwidth}
@samp{--fullheight} there may be some space around the frame or @samp{--fullheight} there may be some space around the frame
anyway. That is because Emacs rounds the sizes so they are an anyway. That is because Emacs rounds the sizes so they are an
even number of character heights and widths. even number of character heights and widths.
......
...@@ -217,8 +217,8 @@ all frames. ...@@ -217,8 +217,8 @@ all frames.
@ifnottex @ifnottex
@item @code{fullscreen} (class @code{Fullscreen}) @item @code{fullscreen} (class @code{Fullscreen})
The desired fullscreen size. The value can be one of @code{fullboth}, The desired fullscreen size. The value can be one of @code{fullboth},
@code{fullwidth} or @code{fullheight}, which correspond to @code{maximized}, @code{fullwidth} or @code{fullheight}, which correspond to
the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh} the command-line options @samp{-fs}, @samp{-mm}, @samp{-fw}, and @samp{-fh}
(@pxref{Window Size X}). (@pxref{Window Size X}).
Note that this applies to the initial frame only. Note that this applies to the initial frame only.
......
2009-07-01 Jan Djärv <jan.h.d@swipnet.se>
* frames.texi (Size Parameters): Mention maximized for fullscreen.
2009-06-24 Chong Yidong <cyd@stupidchicken.com> 2009-06-24 Chong Yidong <cyd@stupidchicken.com>
* display.texi (Window Systems): Add ns to the list. * display.texi (Window Systems): Add ns to the list.
......
...@@ -609,11 +609,15 @@ the @code{user-position} parameter (see above) does for the position ...@@ -609,11 +609,15 @@ the @code{user-position} parameter (see above) does for the position
parameters @code{top} and @code{left}. parameters @code{top} and @code{left}.
@item fullscreen @item fullscreen
Specify that width, height or both shall be set to the size of the screen. Specify that width, height or both shall be maximized.
The value @code{fullwidth} specifies that width shall be the size of the The value @code{fullwidth} specifies that width shall as wide as possible.
screen. The value @code{fullheight} specifies that height shall be the The value @code{fullheight} specifies that height shall be as tall as
size of the screen. The value @code{fullboth} specifies that both the possible. The value @code{fullboth} specifies that both the
width and the height shall be set to the size of the screen. width and the height shall be set to the size of the screen.
The value @code{maximized} specifies that the frame shall be maximized.
The difference between @code{maximized} and @code{fullboth} is that
the first does have window manager decorations but the second does not
and thus really covers the whole screen.
@end table @end table
@node Layout Parameters @node Layout Parameters
......
2009-07-01 Jan Djärv <jan.h.d@swipnet.se>
* NEWS: Mention maximized.
2009-06-30 Michael Albinus <michael.albinus@gmx.de> 2009-06-30 Michael Albinus <michael.albinus@gmx.de>
* NEWS: Add "synce" connection method of Tramp. * NEWS: Add "synce" connection method of Tramp.
......
...@@ -30,6 +30,11 @@ freedesktop.org specifications, the same method used by the Gnome, ...@@ -30,6 +30,11 @@ freedesktop.org specifications, the same method used by the Gnome,
KDE, and XFCE desktops. (This change has no effect on Windows, which KDE, and XFCE desktops. (This change has no effect on Windows, which
uses `system-move-file-to-trash' for trashing.) uses `system-move-file-to-trash' for trashing.)
+++
** Emacs frames can be maximized.
The command line arguments -mm/--maximized and the value maximized to the
frame parameter fullscreen makes the Emacs frame maximized.
* Changes in Specialized Modes and Packages in Emacs 23.2 * Changes in Specialized Modes and Packages in Emacs 23.2
......
2009-07-01 Jan Djärv <jan.h.d@swipnet.se>
* startup.el (command-line-x-option-alist): Add -mm and --maximized.
2009-07-01 Eduard Wiebe <usenet@pusto.de> (tiny change) 2009-07-01 Eduard Wiebe <usenet@pusto.de> (tiny change)
* language/korean.el (set-language-info-alist): Add korean-cp949, * language/korean.el (set-language-info-alist): Add korean-cp949,
......
...@@ -134,6 +134,7 @@ This is normally copied from `default-directory' when Emacs starts.") ...@@ -134,6 +134,7 @@ This is normally copied from `default-directory' when Emacs starts.")
("-fs" 0 x-handle-initial-switch fullscreen fullboth) ("-fs" 0 x-handle-initial-switch fullscreen fullboth)
("-fw" 0 x-handle-initial-switch fullscreen fullwidth) ("-fw" 0 x-handle-initial-switch fullscreen fullwidth)
("-fh" 0 x-handle-initial-switch fullscreen fullheight) ("-fh" 0 x-handle-initial-switch fullscreen fullheight)
("-mm" 0 x-handle-initial-switch fullscreen maximized)
("-ib" 1 x-handle-numeric-switch internal-border-width) ("-ib" 1 x-handle-numeric-switch internal-border-width)
("-g" 1 x-handle-geometry) ("-g" 1 x-handle-geometry)
("-lsp" 1 x-handle-numeric-switch line-spacing) ("-lsp" 1 x-handle-numeric-switch line-spacing)
...@@ -159,6 +160,7 @@ This is normally copied from `default-directory' when Emacs starts.") ...@@ -159,6 +160,7 @@ This is normally copied from `default-directory' when Emacs starts.")
("--fullscreen" 0 x-handle-initial-switch fullscreen fullboth) ("--fullscreen" 0 x-handle-initial-switch fullscreen fullboth)
("--fullwidth" 0 x-handle-initial-switch fullscreen fullwidth) ("--fullwidth" 0 x-handle-initial-switch fullscreen fullwidth)
("--fullheight" 0 x-handle-initial-switch fullscreen fullheight) ("--fullheight" 0 x-handle-initial-switch fullscreen fullheight)
("--maximized" 0 x-handle-initial-switch fullscreen maximized)
("--internal-border" 1 x-handle-numeric-switch internal-border-width) ("--internal-border" 1 x-handle-numeric-switch internal-border-width)
("--geometry" 1 x-handle-geometry) ("--geometry" 1 x-handle-geometry)
("--foreground-color" 1 x-handle-switch foreground-color) ("--foreground-color" 1 x-handle-switch foreground-color)
......
2009-07-01 Jan Djärv <jan.h.d@swipnet.se>
* emacs.c (USAGE3, standard_args): Add -mm and --maximized.
* frame.c: Qmaximized is new.
(x_set_frame_parameters): Do not handle fullscreen specially.
Only set width and height if explicitly set.
(x_set_fullscreen): Handle Qmaximized.
(x_set_font, x_figure_window_size): Do not handle fullscreen specially.
(syms_of_frame): Initialize Qmaximized.
* frame.h (fullscreen_type): Add FULLSCREEN_MAXIMIZED. Declare
Qfullwidth, Qfullheight, Qfullboth, Qmaximized.
* xterm.c (handle_one_xevent): Remove call to x_check_fullscreen
for Expose event. Add call to x_check_fullscreen for MapNotify event.
Remove all code w.r.t. fullscreen from ConfigureNotify event. Do not
set gravity to NorthWestGravity when USE_GTK.
(set_wm_state): New function.
(do_ewmh_fullscreen): Use set_wm_state. Also handle FULLSCREEN_MAXIMIZED.
(x_handle_net_wm_state): Handle FULLSCREEN_MAXIMIZED.
(x_check_fullscreen): Simplify so we only handle EMWH type of fullscreen
or the case when no window manager is running. That means remove calls
to x_real_positions and x_fullscreen_adjust.
* gtkutil.c (flush_and_sync, x_wm_size_hint_off): Remove.
(xg_frame_set_char_size): Remove calls to x_wm_size_hint_off and
flush_and_sync.
(xg_height_changed): New function.
(xg_create_frame_widgets): Remove call to gtk_widget_set_size_request
and gtk_window_set_policy. Set frame gravity after parsing the geometry
string.
(xg_update_frame_menubar, free_frame_menubar)
(xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
(update_frame_tool_bar, free_frame_tool_bar): Call xg_height_changed.
Remove calls to xg_frame_set_char_size.
2009-07-01 Kenichi Handa <handa@m17n.org> 2009-07-01 Kenichi Handa <handa@m17n.org>
* keyboard.c (decode_keyboard_code): New function. * keyboard.c (decode_keyboard_code): New function.
......
...@@ -321,6 +321,7 @@ Display options:\n\ ...@@ -321,6 +321,7 @@ Display options:\n\
--fullheight, -fh make the first frame high as the screen\n\ --fullheight, -fh make the first frame high as the screen\n\
--fullscreen, -fs make first frame fullscreen\n\ --fullscreen, -fs make first frame fullscreen\n\
--fullwidth, -fw make the first frame wide as the screen\n\ --fullwidth, -fw make the first frame wide as the screen\n\
--maximized, -mm make the first frame maximized\n\
--geometry, -g GEOMETRY window geometry\n\ --geometry, -g GEOMETRY window geometry\n\
--no-bitmap-icon, -nbi do not use picture of gnu for Emacs icon\n\ --no-bitmap-icon, -nbi do not use picture of gnu for Emacs icon\n\
--iconic start Emacs in iconified state\n\ --iconic start Emacs in iconified state\n\
...@@ -1917,6 +1918,7 @@ struct standard_args standard_args[] = ...@@ -1917,6 +1918,7 @@ struct standard_args standard_args[] =
{ "-fs", "--fullscreen", 10, 0 }, { "-fs", "--fullscreen", 10, 0 },
{ "-fw", "--fullwidth", 10, 0 }, { "-fw", "--fullwidth", 10, 0 },
{ "-fh", "--fullheight", 10, 0 }, { "-fh", "--fullheight", 10, 0 },
{ "-mm", "--maximized", 10, 0 },
{ "-g", "--geometry", 10, 1 }, { "-g", "--geometry", 10, 1 },
{ "-geometry", 0, 10, 1 }, { "-geometry", 0, 10, 1 },
{ "-T", "--title", 10, 1 }, { "-T", "--title", 10, 1 },
......
...@@ -120,7 +120,7 @@ Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; ...@@ -120,7 +120,7 @@ Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
Lisp_Object Qtty_color_mode; Lisp_Object Qtty_color_mode;
Lisp_Object Qtty, Qtty_type; Lisp_Object Qtty, Qtty_type;
Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth, Qmaximized;
Lisp_Object Qfont_backend; Lisp_Object Qfont_backend;
Lisp_Object Qalpha; Lisp_Object Qalpha;
...@@ -2930,11 +2930,7 @@ x_set_frame_parameters (f, alist) ...@@ -2930,11 +2930,7 @@ x_set_frame_parameters (f, alist)
int i, p; int i, p;
int left_no_change = 0, top_no_change = 0; int left_no_change = 0, top_no_change = 0;
int icon_left_no_change = 0, icon_top_no_change = 0; int icon_left_no_change = 0, icon_top_no_change = 0;
int fullscreen_is_being_set = 0; int size_changed = 0;
int height_for_full_width = 0;
int width_for_full_height = 0;
enum fullscreen_type fullscreen_wanted = FULLSCREEN_NONE;
struct gcpro gcpro1, gcpro2; struct gcpro gcpro1, gcpro2;
i = 0; i = 0;
...@@ -2976,7 +2972,6 @@ x_set_frame_parameters (f, alist) ...@@ -2976,7 +2972,6 @@ x_set_frame_parameters (f, alist)
They are independent of other properties, but other properties (e.g., They are independent of other properties, but other properties (e.g.,
cursor_color) are dependent upon them. */ cursor_color) are dependent upon them. */
/* Process default font as well, since fringe widths depends on it. */ /* Process default font as well, since fringe widths depends on it. */
/* Also, process fullscreen, width and height depend upon that. */
for (p = 0; p < i; p++) for (p = 0; p < i; p++)
{ {
Lisp_Object prop, val; Lisp_Object prop, val;
...@@ -2985,26 +2980,11 @@ x_set_frame_parameters (f, alist) ...@@ -2985,26 +2980,11 @@ x_set_frame_parameters (f, alist)
val = values[p]; val = values[p];
if (EQ (prop, Qforeground_color) if (EQ (prop, Qforeground_color)
|| EQ (prop, Qbackground_color) || EQ (prop, Qbackground_color)
|| EQ (prop, Qfont) || EQ (prop, Qfont))
|| EQ (prop, Qfullscreen))
{ {
register Lisp_Object param_index, old_value; register Lisp_Object param_index, old_value;
if (EQ (prop, Qfullscreen))
{
/* The parameter handler can reset f->want_fullscreen to
FULLSCREEN_NONE. But we need the requested value later
to decide whether a height or width parameter shall be
applied. Therefore, we remember the requested value in
fullscreen_wanted for the following two cases. */
if (EQ (val, Qfullheight))
fullscreen_wanted = FULLSCREEN_HEIGHT;
else if (EQ (val, Qfullwidth))
fullscreen_wanted = FULLSCREEN_WIDTH;
}
old_value = get_frame_param (f, prop); old_value = get_frame_param (f, prop);
fullscreen_is_being_set |= EQ (prop, Qfullscreen);
if (NILP (Fequal (val, old_value))) if (NILP (Fequal (val, old_value)))
{ {
store_frame_param (f, prop, val); store_frame_param (f, prop, val);
...@@ -3028,9 +3008,15 @@ x_set_frame_parameters (f, alist) ...@@ -3028,9 +3008,15 @@ x_set_frame_parameters (f, alist)
val = values[i]; val = values[i];
if (EQ (prop, Qwidth) && NATNUMP (val)) if (EQ (prop, Qwidth) && NATNUMP (val))
width_for_full_height = width = XFASTINT (val); {
size_changed = 1;
width = XFASTINT (val);
}
else if (EQ (prop, Qheight) && NATNUMP (val)) else if (EQ (prop, Qheight) && NATNUMP (val))
height_for_full_width = height = XFASTINT (val); {
size_changed = 1;
height = XFASTINT (val);
}
else if (EQ (prop, Qtop)) else if (EQ (prop, Qtop))
top = val; top = val;
else if (EQ (prop, Qleft)) else if (EQ (prop, Qleft))
...@@ -3041,8 +3027,7 @@ x_set_frame_parameters (f, alist) ...@@ -3041,8 +3027,7 @@ x_set_frame_parameters (f, alist)
icon_left = val; icon_left = val;
else if (EQ (prop, Qforeground_color) else if (EQ (prop, Qforeground_color)
|| EQ (prop, Qbackground_color) || EQ (prop, Qbackground_color)
|| EQ (prop, Qfont) || EQ (prop, Qfont))
|| EQ (prop, Qfullscreen))
/* Processed above. */ /* Processed above. */
continue; continue;
else else
...@@ -3096,31 +3081,6 @@ x_set_frame_parameters (f, alist) ...@@ -3096,31 +3081,6 @@ x_set_frame_parameters (f, alist)
XSETINT (icon_top, 0); XSETINT (icon_top, 0);
} }
if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set)
{
/* If the frame is visible already and the fullscreen parameter is
being set, it is too late to set WM manager hints to specify
size and position.
Here we first get the width, height and position that applies to
fullscreen. We then move the frame to the appropriate
position. Resize of the frame is taken care of in the code after
this if-statement. */
int new_left, new_top;
x_fullscreen_adjust (f, &width, &height, &new_top, &new_left);
if (new_top != f->top_pos || new_left != f->left_pos)
x_set_offset (f, new_left, new_top, 1);
/* When both height and fullwidth were requested, make sure the
requested value for height gets applied. */
if (height_for_full_width && fullscreen_wanted == FULLSCREEN_WIDTH)
height = height_for_full_width;
/* When both width and fullheight were requested, make sure the
requested value for width gets applied. */
if (width_for_full_height && fullscreen_wanted == FULLSCREEN_HEIGHT)
width = width_for_full_height;
}
/* Don't set these parameters unless they've been explicitly /* Don't set these parameters unless they've been explicitly
specified. The window might be mapped or resized while we're in specified. The window might be mapped or resized while we're in
this function, and we don't want to override that unless the lisp this function, and we don't want to override that unless the lisp
...@@ -3136,10 +3096,11 @@ x_set_frame_parameters (f, alist) ...@@ -3136,10 +3096,11 @@ x_set_frame_parameters (f, alist)
XSETFRAME (frame, f); XSETFRAME (frame, f);
if (width != FRAME_COLS (f) if (size_changed
|| height != FRAME_LINES (f) && (width != FRAME_COLS (f)
|| f->new_text_lines || f->new_text_cols) || height != FRAME_LINES (f)
Fset_frame_size (frame, make_number (width), make_number (height)); || f->new_text_lines || f->new_text_cols))
Fset_frame_size (frame, make_number (width), make_number (height));
if ((!NILP (left) || !NILP (top)) if ((!NILP (left) || !NILP (top))
&& ! (left_no_change && top_no_change) && ! (left_no_change && top_no_change)
...@@ -3299,12 +3260,14 @@ x_set_fullscreen (f, new_value, old_value) ...@@ -3299,12 +3260,14 @@ x_set_fullscreen (f, new_value, old_value)
{ {
if (NILP (new_value)) if (NILP (new_value))
f->want_fullscreen = FULLSCREEN_NONE; f->want_fullscreen = FULLSCREEN_NONE;
else if (EQ (new_value, Qfullboth)) else if (EQ (new_value, Qfullboth) || EQ (new_value, Qfullscreen))
f->want_fullscreen = FULLSCREEN_BOTH; f->want_fullscreen = FULLSCREEN_BOTH;
else if (EQ (new_value, Qfullwidth)) else if (EQ (new_value, Qfullwidth))
f->want_fullscreen = FULLSCREEN_WIDTH; f->want_fullscreen = FULLSCREEN_WIDTH;
else if (EQ (new_value, Qfullheight)) else if (EQ (new_value, Qfullheight))
f->want_fullscreen = FULLSCREEN_HEIGHT; f->want_fullscreen = FULLSCREEN_HEIGHT;
else if (EQ (new_value, Qmaximized))
f->want_fullscreen = FULLSCREEN_MAXIMIZED;
if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) if (FRAME_TERMINAL (f)->fullscreen_hook != NULL)
FRAME_TERMINAL (f)->fullscreen_hook (f); FRAME_TERMINAL (f)->fullscreen_hook (f);
...@@ -3443,19 +3406,6 @@ x_set_font (f, arg, oldval) ...@@ -3443,19 +3406,6 @@ x_set_font (f, arg, oldval)
if (CONSP (lval)) lval = CDR (lval); if (CONSP (lval)) lval = CDR (lval);
x_new_font (f, font_object, fontset); x_new_font (f, font_object, fontset);
/* If the fullscreen property is non-nil, adjust lines and columns so we
keep the same pixel height and width. */
if (! NILP (lval))
{
int height = FRAME_LINES (f), width = FRAME_COLS (f);
if (EQ (lval, Qfullboth) || EQ (lval, Qfullwidth))
width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
if (EQ (lval, Qfullboth) || EQ (lval, Qfullheight))
height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f));
change_frame_size (f, height, width, 0, 0, 1);
}
store_frame_param (f, Qfont, arg); store_frame_param (f, Qfont, arg);
/* Recalculate toolbar height. */ /* Recalculate toolbar height. */
f->n_tool_bar_rows = 0; f->n_tool_bar_rows = 0;
...@@ -4374,22 +4324,6 @@ x_figure_window_size (f, parms, toolbar_p) ...@@ -4374,22 +4324,6 @@ x_figure_window_size (f, parms, toolbar_p)
window_prompting |= PPosition; window_prompting |= PPosition;
} }
if (f->want_fullscreen != FULLSCREEN_NONE)
{
int left, top;
int width, height;
/* It takes both for some WM:s to place it where we want */
window_prompting |= USPosition | PPosition;
x_fullscreen_adjust (f, &width, &height, &top, &left);
FRAME_COLS (f) = width;
FRAME_LINES (f) = height;
FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
f->left_pos = left;
f->top_pos = top;
}
if (window_prompting & XNegative) if (window_prompting & XNegative)
{ {
if (window_prompting & YNegative) if (window_prompting & YNegative)
...@@ -4503,6 +4437,8 @@ syms_of_frame () ...@@ -4503,6 +4437,8 @@ syms_of_frame ()
staticpro (&Qfullheight); staticpro (&Qfullheight);
Qfullboth = intern ("fullboth"); Qfullboth = intern ("fullboth");
staticpro (&Qfullboth); staticpro (&Qfullboth);
Qmaximized = intern ("maximized");
staticpro (&Qmaximized);
Qx_resource_name = intern ("x-resource-name"); Qx_resource_name = intern ("x-resource-name");
staticpro (&Qx_resource_name); staticpro (&Qx_resource_name);
......
...@@ -75,12 +75,12 @@ enum text_cursor_kinds ...@@ -75,12 +75,12 @@ enum text_cursor_kinds
enum fullscreen_type enum fullscreen_type
{ {
/* Values used as a bit mask, BOTH == WIDTH | HEIGHT. */ FULLSCREEN_NONE,
FULLSCREEN_NONE = 0, FULLSCREEN_WIDTH = 0x001,
FULLSCREEN_WIDTH = 1, FULLSCREEN_HEIGHT = 0x002,
FULLSCREEN_HEIGHT = 2, FULLSCREEN_BOTH = 0x003,
FULLSCREEN_BOTH = 3, FULLSCREEN_MAXIMIZED = 0x013,
FULLSCREEN_WAIT = 4 FULLSCREEN_WAIT = 0x100
}; };
...@@ -1038,6 +1038,7 @@ extern Lisp_Object Qscreen_gamma; ...@@ -1038,6 +1038,7 @@ extern Lisp_Object Qscreen_gamma;
extern Lisp_Object Qline_spacing; extern Lisp_Object Qline_spacing;
extern Lisp_Object Qwait_for_wm; extern Lisp_Object Qwait_for_wm;
extern Lisp_Object Qfullscreen; extern Lisp_Object Qfullscreen;
extern Lisp_Object Qfullwidth, Qfullheight, Qfullboth, Qmaximized;
extern Lisp_Object Qfont_backend; extern Lisp_Object Qfont_backend;
extern Lisp_Object Qalpha; extern Lisp_Object Qalpha;
......
...@@ -308,7 +308,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap) ...@@ -308,7 +308,7 @@ xg_get_pixbuf_from_pix_and_mask (gpix, gmask, cmap)
} }
static Lisp_Object static Lisp_Object
file_for_image(image) file_for_image (image)
Lisp_Object image; Lisp_Object image;
{ {
Lisp_Object specified_file = Qnil; Lisp_Object specified_file = Qnil;
...@@ -655,48 +655,6 @@ xg_frame_resized (f, pixelwidth, pixelheight) ...@@ -655,48 +655,6 @@ xg_frame_resized (f, pixelwidth, pixelheight)
} }
} }
/* Process all pending events on the display for frame F. */
static void
flush_and_sync (f)
FRAME_PTR f;
{
gdk_window_process_all_updates ();
x_sync (f);
while (gtk_events_pending ())
{
gtk_main_iteration ();
gdk_window_process_all_updates ();
x_sync (f);
}
}
/* Turn wm hints for resize off on frame F */
static void
x_wm_size_hint_off (f)
FRAME_PTR f;
{
GdkGeometry size_hints;
gint hint_flags = 0;
memset (&size_hints, 0, sizeof (size_hints));
hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
size_hints.width_inc = 1;
size_hints.height_inc = 1;
hint_flags |= GDK_HINT_BASE_SIZE;
size_hints.base_width = 1;
size_hints.base_height = 1;
size_hints.min_width = 1;
size_hints.min_height = 1;
gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
NULL,
&size_hints,
hint_flags);
/* Make sure these get set again in next call to x_wm_set_size_hint. */
f->output_data.x->hint_flags &= ~hint_flags;
flush_and_sync (f);
}
/* Resize the outer window of frame F after chainging the height. /* Resize the outer window of frame F after chainging the height.
This happend when the menu bar or the tool bar is added or removed. This happend when the menu bar or the tool bar is added or removed.
COLUMNS/ROWS is the size the edit area shall have after the resize. */ 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,13 +687,10 @@ xg_frame_set_char_size (f, cols, rows)
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
/* Must resize our top level widget. Font size may have changed, /* Must resize our top level widget. Font size may have changed,
but not rows/cols. but not rows/cols. */
Turn wm hints (min/max size and size increments) of temporarly.
It interferes too much, when for example adding or removing the
menu/tool bar. */
x_wm_size_hint_off (f);
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
pixelwidth, pixelheight); pixelwidth, pixelheight);
x_wm_set_size_hint (f, 0, 0);
/* Now, strictly speaking, we can't be sure that this is accurate, /* Now, strictly speaking, we can't be sure that this is accurate,
but the window manager will get around to dealing with the size 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,7 +714,18 @@ xg_frame_set_char_size (f, cols, rows)
for, then the event won't cause the screen to become garbaged, so for, then the event won't cause the screen to become garbaged, so
we have to make sure to do it here. */ we have to make sure to do it here. */
SET_FRAME_GARBAGED (f); SET_FRAME_GARBAGED (f);
flush_and_sync (f); }
/* Handle height changes (i.e. add/remove menu/toolbar).
The policy is to keep the number of editable lines. */
static void
xg_height_changed (f)
FRAME_PTR f;
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
f->output_data.x->hint_flags = 0;
x_wm_set_size_hint (f, 0, 0); x_wm_set_size_hint (f, 0, 0);
} }
...@@ -859,9 +825,6 @@ xg_create_frame_widgets (f) ...@@ -859,9 +825,6 @@ xg_create_frame_widgets (f)
gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE); gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
gtk_widget_set_size_request (wfixed, FRAME_PIXEL_WIDTH (f),
FRAME_PIXEL_HEIGHT (f));
gtk_container_add (GTK_CONTAINER (wtop), wvbox); gtk_container_add (GTK_CONTAINER (wtop), wvbox);
gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0); gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
...@@ -875,9 +838,6 @@ xg_create_frame_widgets (f) ...@@ -875,9 +838,6 @@ xg_create_frame_widgets (f)
a lot, so we turn off double buffering. */ a lot, so we turn off double buffering. */
gtk_widget_set_double_buffered (wfixed, FALSE); gtk_widget_set_double_buffered (wfixed, FALSE);
/* GTK documents says use gtk_window_set_resizable. But then a user
can't shrink the window from its starting size. */
gtk_window_set_policy (GTK_WINDOW (wtop), TRUE, TRUE, TRUE);
gtk_window_set_wmclass (GTK_WINDOW (wtop), gtk_window_set_wmclass (GTK_WINDOW (wtop),
SSDATA (Vx_resource_name), SSDATA (Vx_resource_name),
SSDATA (Vx_resource_class)); SSDATA (Vx_resource_class));
...@@ -891,6 +851,8 @@ xg_create_frame_widgets (f) ...@@ -891,6 +851,8 @@ xg_create_frame_widgets (f)
and specify it. and specify it.
GTK will itself handle calculating the real position this way. */ GTK will itself handle calculating the real position this way. */
xg_set_geometry (f); xg_set_geometry (f);
int grav = gtk_window_get_gravity (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
f->win_gravity = grav;
gtk_widget_add_events (wfixed, gtk_widget_add_events (wfixed,
GDK_POINTER_MOTION_MASK GDK_POINTER_MOTION_MASK
...@@ -2987,14 +2949,8 @@ xg_update_frame_menubar (f) ...@@ -2987,14 +2949,8 @@ xg_update_frame_menubar (f)
gtk_widget_show_all (x->menubar_widget); gtk_widget_show_all (x->menubar_widget);
gtk_widget_size_request (x->menubar_widget, &req); gtk_widget_size_request (x->menubar_widget, &req);
FRAME_MENUBAR_HEIGHT (f) = req.height; FRAME_MENUBAR_HEIGHT (f) = req.height;
xg_height_changed (f);
/* The height has changed, resize outer widget and set columns