From: Martin Rudalics Date: Fri, 21 Mar 2014 09:23:22 +0000 (+0100) Subject: Truly maximize w32 frames with odd fonts and some texi fixes. X-Git-Tag: emacs-24.3.90~128 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21e18b30e2a15b726b9822cb7bb086792465a6d1;p=emacs.git Truly maximize w32 frames with odd fonts and some texi fixes. * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't constrain frame size in SW_SHOWMAXIMIZED case so we can truly maximize a frame for odd default fonts. * frames.texi (Size and Position): In `frame-resize-pixelwise' description drop remark about frame maximization. * windows.texi (Display Action Functions): Add description for `display-buffer-no-window' and explain use of `allow-no-window' alist entries. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 331784ecae0..3bbcee76884 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2014-03-21 Martin Rudalics + + * frames.texi (Size and Position): In `frame-resize-pixelwise' + description drop remark about frame maximization. + * windows.texi (Display Action Functions): Add description for + `display-buffer-no-window' and explain use of `allow-no-window' + alist entries. + 2014-03-21 Glenn Morris * commands.texi (Defining Commands): Copyedit re `interactive-only'. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index e896d1b4c04..b6513426909 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -1163,10 +1163,7 @@ on the toolkit used: Dragging the frame border with the mouse is usually always done character-wise. Calling @code{set-frame-size} (see below) with arguments that do not specify the frame size as an integer multiple of its character size may be, however, either ignored or cause a -rounding (GTK+, Windows) or get accepted (Lucid, Motif). This also -means that with some toolkits and a display whose size is not an -integral multiple of your default font, you may have to set this to -non-@code{nil} in order to fully maximize a frame. +rounding (GTK+, Windows) or get accepted (Lucid, Motif). @end defopt @defun set-frame-size frame width height pixelwise diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 1b3fc377d61..e4177836fa8 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2280,6 +2280,15 @@ window and displaying the buffer in that window. It can fail if all windows are dedicated to another buffer (@pxref{Dedicated Windows}). @end defun +@defun display-buffer-no-window buffer alist +If @var{alist} has a non-@code{nil} @code{allow-no-window} entry, then +this function does not display @code{buffer}. This allows to override +the default action and avoid displaying the buffer. It is assumed that +when the caller specifies a non-@code{nil} @code{allow-no-window} value +it can handle a @code{nil} value returned from @code{display-buffer} in +this case. +@end defun + To illustrate the use of action functions, consider the following example. diff --git a/etc/NEWS b/etc/NEWS index ccf71b3feb1..a816a20810c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -210,6 +210,7 @@ bound to and M-, respectively. *** New hooks `focus-in-hook', `focus-out-hook'. These are normal hooks run when an Emacs frame gains or loses input focus. ++++ *** Emacs can now change frame sizes in units of pixels, rather than text rows or columns. When maximizing a frame or making it fullscreen, remaining extra pixels are no longer given to the minibuffer, the rightmost @@ -218,6 +219,7 @@ areas of the frame's windows. If the new option `frame-resize-pixelwise' is non-nil, all frame size changes happen pixelwise and set the corresponding size hints for the window manager. ++++ *** Emacs can now change window sizes in units of pixels. Mouse-dragging a mode line or window divider now changes the size of adjacent windows pixelwise. If the new option `window-resize-pixelwise' @@ -231,6 +233,7 @@ or values to be returned, in pixels instead of lines/columns. count partially visible lines or columns if called with a nil PIXELWISE argument. ++++ *** Emacs can now draw dividers between adjacent windows. To put dividers between side-by-side/vertically stacked windows customize the frame parameters `right-divider-width' and `bottom-divider-width' to @@ -241,25 +244,30 @@ the appearance of dividers by customizing the faces `window-divider', two are useful to provide a 3D effect, or to better distinguish dividers from surrounding display objects. ++++ *** New functions are provided to return the pixel sizes of window components, namely `window-scroll-bar-width', `window-mode-line-height' `window-header-line-height', `window-right-divider-width' and `window-bottom-divider-width'. ++++ *** The new function `window-text-pixel-size' returns the size of the text of a window's buffer in pixels. This allows functions like `fit-frame-to-buffer' and `fit-window-to-buffer' to accurately fit a window to its buffer as it will be displayed. ++++ *** `fit-window-to-buffer' can now resize windows in both dimensions. This behavior is controlled by the new option `fit-window-to-buffer-horizontally'. The new option `fit-frame-to-buffer' allows to fit the window's frame to its buffer. ++++ *** `fit-frame-to-buffer' now fits frames in both dimensions. The new options `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes' control the size of the frame and its position on screen. +--- *** Temp Buffer Resize Mode can now adjust height and width of windows and frames. `temp-buffer-resize-mode' is now able to adjust the height and the width of a window displaying a temporary buffer. The new option @@ -298,9 +306,11 @@ buffer. `display-buffer' choose or make a window at the bottom of the selected frame. ++++ *** New display action function `display-buffer-no-window' to not display the buffer in a window. ++++ *** New display action alist entry `allow-no-window' to indicate the caller of `display-buffer' is ready to handle the case of not displaying the buffer in a window. diff --git a/src/ChangeLog b/src/ChangeLog index d2572e74048..ccd8fb46957 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-03-21 Martin Rudalics + + * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't + constrain frame size in SW_SHOWMAXIMIZED case so we can truly + maximize a frame for odd default fonts. + 2014-03-20 Paul Eggert * doc.c (store_function_docstring): Fix pointer signedness mismatch. diff --git a/src/w32fns.c b/src/w32fns.c index a5b8abfa6b1..ffe63a3cf2d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -3805,7 +3805,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) wp.length = sizeof (WINDOWPLACEMENT); GetWindowPlacement (hwnd, &wp); - if (wp.showCmd != SW_SHOWMINIMIZED && (lppos->flags & SWP_NOSIZE) == 0) + if (wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED + && (lppos->flags & SWP_NOSIZE) == 0) { RECT rect; int wdiff; diff --git a/src/w32term.c b/src/w32term.c index 2981320e136..ac8f9a2092d 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5651,21 +5651,11 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b if (!frame_resize_pixelwise) { /* If we don't resize frames pixelwise, round sizes to multiples - of character sizes. Otherwise, Windows may clip our frame - rectangle at a character size boundary and we risk losing our - mode line. Bug#16923 might be a consequence of this. - - So far, this is a Windows specific problem; other toolkits may - prefer to not resize the frame if the delta is not large enough - (GTK) or resize the frame pixelwise as requested (Lucid, - Motif). Windows just doesn't call us back (probably because of - the size hint settings which it apparently interprets strictly) - neither when the user tries to mouse-drag a frame border by, - nor when calling `set-frame-size' with a delta of less than the - canonical character size. If w32_enable_frame_resize_hack is - enabled (which it now is by default) we'd then below resize the - frame's root window in preparation of a WM_SIZE message to come - which, however, is not going to happen. */ + of character sizes here. Otherwise, when enforcing size hints + while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might + clip our frame rectangle to a multiple of the frame's character + size and subsequently lose our mode line or scroll bar. + Bug#16923 could be one possible consequence of this. */ int unit_width = FRAME_COLUMN_WIDTH (f); int unit_height = FRAME_LINE_HEIGHT (f); @@ -5695,9 +5685,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b } /* If w32_enable_frame_resize_hack is non-nil, immediately apply the - new pixel sizes to the frame and its subwindows. This approach is - fragile because Windows might not honor the resize request issued - by my_set_window_pos with a WM_SIZE message (see previous comment). + new pixel sizes to the frame and its subwindows. Jason Rumney earlier refused to call change_frame_size right here with the following argument: