summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2014-03-26 16:57:13 +0100
committerJuanma Barranquero <lekktu@gmail.com>2014-03-26 16:57:13 +0100
commit16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614 (patch)
tree29b782fd6e7c44a834dd09442a551520e30bcbd6 /src/w32term.c
parent5af73b0fe8975eeb47fb270819b4143c18d71caa (diff)
parent196716cf35f81bea108c3b75362e92c86ed1c016 (diff)
downloademacs-16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614.tar.gz
Merge from emacs-24; up to 2014-03-23T23:14:52Z!yamaoka@jpl.org
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 52eccc27e81..e8ec99e762d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5653,30 +5653,41 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
compute_fringe_widths (f, 0);
- if (pixelwise)
+ if (frame_resize_pixelwise)
{
- pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
- pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
+ if (pixelwise)
+ {
+ pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
+ }
+ else
+ {
+ pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
+ pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
+ }
}
else
{
- pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
- pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
- }
-
- if (!frame_resize_pixelwise)
- {
/* If we don't resize frames pixelwise, round sizes to multiples
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. */
+ Bug#16923 could be one possible consequence of this. Carefully
+ reverse-engineer what WM_WINDOWPOSCHANGING does here since
+ otherwise we might make our frame too small, see Bug#17077. */
int unit_width = FRAME_COLUMN_WIDTH (f);
int unit_height = FRAME_LINE_HEIGHT (f);
- pixelwidth = (pixelwidth / unit_width) * unit_width;
- pixelheight = (pixelheight / unit_height) * unit_height;
+ pixelwidth = (((((pixelwise ? width : (width * FRAME_COLUMN_WIDTH (f)))
+ + FRAME_TOTAL_FRINGE_WIDTH (f))
+ / unit_width) * unit_width)
+ + FRAME_SCROLL_BAR_AREA_WIDTH (f)
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+
+ pixelheight = ((((pixelwise ? height : (height * FRAME_LINE_HEIGHT (f)))
+ / unit_height) * unit_height)
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
}
f->win_gravity = NorthWestGravity;