diff -r 7a34490312a4 -r db130fea0a60 doc/emacs/xresources.texi --- a/doc/emacs/xresources.texi Thu Aug 21 08:23:02 2008 +0200 +++ b/doc/emacs/xresources.texi Sun Aug 24 10:08:44 2008 +0200 @@ -237,8 +237,8 @@ @ifnottex @item @code{fullscreen} (class @code{Fullscreen}) The desired fullscreen size. The value can be one of @code{fullboth}, -@code{fullwidth} or @code{fullheight}, which correspond to -the command-line options @samp{-fs}, @samp{-fw}, and @samp{-fh} +@code{fullheight}, @code{fullwidth} or @code{maximize} which correspond to +the command-line options @samp{-fs}, @samp{-fh}, @samp{-fw} and @samp{-fm} (@pxref{Window Size X}). Note that this applies to the initial frame only. diff -r 7a34490312a4 -r db130fea0a60 doc/lispref/frames.texi --- a/doc/lispref/frames.texi Thu Aug 21 08:23:02 2008 +0200 +++ b/doc/lispref/frames.texi Sun Aug 24 10:08:44 2008 +0200 @@ -481,8 +481,11 @@ Specify that width, height or both shall be set to the size of the screen. The value @code{fullwidth} specifies that width shall be the size of the screen. The value @code{fullheight} specifies that height shall be the -size of the screen. The value @code{fullboth} specifies that both the -width and the height shall be set to the size of the screen. +size of the screen. The value @code{maximize} specifies that both the +width and the height shall be set to the size of the screen. The value +@code{fullboth} toggles full-screen mode, all windows decoration are hidden +such as title bar and border. The desktop taskbar is also hidden so it +looks like emacs is running on a console. @end table @node Layout Parameters diff -r 7a34490312a4 -r db130fea0a60 doc/man/emacs.1 --- a/doc/man/emacs.1 Thu Aug 21 08:23:02 2008 +0200 +++ b/doc/man/emacs.1 Sun Aug 24 10:08:44 2008 +0200 @@ -443,11 +443,12 @@ The desired fullscreen size. The value can be one of .IR fullboth , +.IR fullheight , .IR fullwidth , or -.IR fullheight , -which correspond to the command-line options `\-fs', `\-fw', and -`\-fh', respectively. +.IR maximize , +which correspond to the command-line options `\-fs', `\-fh', +`\-fw', and `\-fm' respectively. Note that this applies to the initial frame only. .TP .BR geometry " (class " Geometry ) diff -r 7a34490312a4 -r db130fea0a60 lisp/startup.el --- a/lisp/startup.el Thu Aug 21 08:23:02 2008 +0200 +++ b/lisp/startup.el Sun Aug 24 10:08:44 2008 +0200 @@ -134,6 +134,7 @@ ("-fs" 0 x-handle-initial-switch fullscreen fullboth) ("-fw" 0 x-handle-initial-switch fullscreen fullwidth) ("-fh" 0 x-handle-initial-switch fullscreen fullheight) + ("-fm" 0 x-handle-initial-switch fullscreen maximize) ("-ib" 1 x-handle-numeric-switch internal-border-width) ("-g" 1 x-handle-geometry) ("-lsp" 1 x-handle-numeric-switch line-spacing) @@ -159,6 +160,7 @@ ("--fullscreen" 0 x-handle-initial-switch fullscreen fullboth) ("--fullwidth" 0 x-handle-initial-switch fullscreen fullwidth) ("--fullheight" 0 x-handle-initial-switch fullscreen fullheight) + ("--fullmax" 0 x-handle-initial-switch fullscreen maximize) ("--internal-border" 1 x-handle-numeric-switch internal-border-width) ("--geometry" 1 x-handle-geometry) ("--foreground-color" 1 x-handle-switch foreground-color) diff -r 7a34490312a4 -r db130fea0a60 src/frame.c --- a/src/frame.c Thu Aug 21 08:23:02 2008 +0200 +++ b/src/frame.c Sun Aug 24 10:08:44 2008 +0200 @@ -120,7 +120,7 @@ Lisp_Object Qtty_color_mode; Lisp_Object Qtty, Qtty_type; -Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; +Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth, Qmaximize; Lisp_Object Qfont_backend; Lisp_Object Qalpha; @@ -3262,6 +3262,8 @@ f->want_fullscreen = FULLSCREEN_WIDTH; else if (EQ (new_value, Qfullheight)) f->want_fullscreen = FULLSCREEN_HEIGHT; + else if (EQ (new_value, Qmaximize)) + f->want_fullscreen = FULLSCREEN_MAXIMIZE; if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) FRAME_TERMINAL (f)->fullscreen_hook (f); @@ -4423,6 +4425,8 @@ staticpro (&Qfullheight); Qfullboth = intern ("fullboth"); staticpro (&Qfullboth); + Qmaximize = intern ("maximize"); + staticpro (&Qmaximize); Qx_resource_name = intern ("x-resource-name"); staticpro (&Qx_resource_name); diff -r 7a34490312a4 -r db130fea0a60 src/frame.h --- a/src/frame.h Thu Aug 21 08:23:02 2008 +0200 +++ b/src/frame.h Sun Aug 24 10:08:44 2008 +0200 @@ -75,12 +75,12 @@ enum fullscreen_type { - /* Values used as a bit mask, BOTH == WIDTH | HEIGHT. */ - FULLSCREEN_NONE = 0, - FULLSCREEN_WIDTH = 1, - FULLSCREEN_HEIGHT = 2, - FULLSCREEN_BOTH = 3, - FULLSCREEN_WAIT = 4 + FULLSCREEN_NONE = 0x0, + FULLSCREEN_WIDTH = 0x1, + FULLSCREEN_HEIGHT = 0x2, + FULLSCREEN_BOTH = 0x4, + FULLSCREEN_WAIT = 0x8, + FULLSCREEN_MAXIMIZE = 0x10 }; diff -r 7a34490312a4 -r db130fea0a60 src/xterm.c --- a/src/xterm.c Thu Aug 21 08:23:02 2008 +0200 +++ b/src/xterm.c Sun Aug 24 10:08:44 2008 +0200 @@ -8580,9 +8580,10 @@ break; } - if (what != NULL && !wm_supports (f, what)) return 0; - - + /* Only remove element when setting to none so that maxmize + works properley */ + if (f->want_fullscreen == FULLSCREEN_NONE) + { Fx_send_client_event (frame, make_number (0), frame, make_unibyte_string (atom, strlen (atom)), make_number (32), @@ -8607,6 +8608,10 @@ (make_unibyte_string (fw, strlen (fw)), Qnil))); + } + + if (what != NULL && !wm_supports (f, what)) return 0; + f->want_fullscreen = FULLSCREEN_NONE; if (what != NULL) Fx_send_client_event (frame, make_number (0), frame, @@ -8626,7 +8631,15 @@ XTfullscreen_hook (f) FRAME_PTR f; { - if (f->async_visible) + /* Maximise in X is full height plus full width */ + if (f->want_fullscreen == FULLSCREEN_MAXIMIZE) + { + f->want_fullscreen = FULLSCREEN_HEIGHT; + XTfullscreen_hook(f); + f->want_fullscreen = FULLSCREEN_WIDTH; + XTfullscreen_hook(f); + } + else if (f->async_visible) { BLOCK_INPUT; do_ewmh_fullscreen (f);