1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-23 10:34:07 +00:00

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.
This commit is contained in:
Martin Rudalics 2014-03-21 10:23:22 +01:00
parent 78540c42f1
commit 21e18b30e2
7 changed files with 42 additions and 23 deletions

View File

@ -1,3 +1,11 @@
2014-03-21 Martin Rudalics <rudalics@gmx.at>
* 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 <rgm@gnu.org>
* commands.texi (Defining Commands): Copyedit re `interactive-only'.

View File

@ -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

View File

@ -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.

View File

@ -210,6 +210,7 @@ bound to <f11> and M-<f10>, 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.

View File

@ -1,3 +1,9 @@
2014-03-21 Martin Rudalics <rudalics@gmx.at>
* 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 <eggert@cs.ucla.edu>
* doc.c (store_function_docstring): Fix pointer signedness mismatch.

View File

@ -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;

View File

@ -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: