diff options
| author | Martin Rudalics | 2014-03-24 09:50:17 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-03-24 09:50:17 +0100 |
| commit | f2999a33d0d67867997c66c777e0d6df1076e18d (patch) | |
| tree | b107e877bdf774ac8fb624316f426331fe015ad7 /src | |
| parent | 39e98ed4ff2a2f10b029a2280084495b0294bca9 (diff) | |
| download | emacs-f2999a33d0d67867997c66c777e0d6df1076e18d.tar.gz emacs-f2999a33d0d67867997c66c777e0d6df1076e18d.zip | |
Refine previous fix of x_set_window_size to handle Bug#17077.
* w32term.c (x_set_window_size): Refine fix from 2014-03-14
(Bug#17077).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/w32term.c | 35 |
2 files changed, 28 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2069d00a240..da82eca9df2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-03-24 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * w32term.c (x_set_window_size): Refine fix from 2014-03-14 | ||
| 4 | (Bug#17077). | ||
| 5 | |||
| 1 | 2014-03-23 Glenn Morris <rgm@gnu.org> | 6 | 2014-03-23 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * fileio.c (Ffile_symlink_p): Doc fix. (Bug#17073) | 8 | * fileio.c (Ffile_symlink_p): Doc fix. (Bug#17073) |
diff --git a/src/w32term.c b/src/w32term.c index 15b502b7c1b..4c426aca921 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 | |||
| 5653 | 5653 | ||
| 5654 | compute_fringe_widths (f, 0); | 5654 | compute_fringe_widths (f, 0); |
| 5655 | 5655 | ||
| 5656 | if (pixelwise) | 5656 | if (frame_resize_pixelwise) |
| 5657 | { | 5657 | { |
| 5658 | pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); | 5658 | if (pixelwise) |
| 5659 | pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); | 5659 | { |
| 5660 | pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width); | ||
| 5661 | pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); | ||
| 5662 | } | ||
| 5663 | else | ||
| 5664 | { | ||
| 5665 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); | ||
| 5666 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); | ||
| 5667 | } | ||
| 5660 | } | 5668 | } |
| 5661 | else | 5669 | else |
| 5662 | { | 5670 | { |
| 5663 | pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); | ||
| 5664 | pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); | ||
| 5665 | } | ||
| 5666 | |||
| 5667 | if (!frame_resize_pixelwise) | ||
| 5668 | { | ||
| 5669 | /* If we don't resize frames pixelwise, round sizes to multiples | 5671 | /* If we don't resize frames pixelwise, round sizes to multiples |
| 5670 | of character sizes here. Otherwise, when enforcing size hints | 5672 | of character sizes here. Otherwise, when enforcing size hints |
| 5671 | while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might | 5673 | while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might |
| 5672 | clip our frame rectangle to a multiple of the frame's character | 5674 | clip our frame rectangle to a multiple of the frame's character |
| 5673 | size and subsequently lose our mode line or scroll bar. | 5675 | size and subsequently lose our mode line or scroll bar. |
| 5674 | Bug#16923 could be one possible consequence of this. */ | 5676 | Bug#16923 could be one possible consequence of this. Carefully |
| 5677 | reverse-engineer what WM_WINDOWPOSCHANGING does here since | ||
| 5678 | otherwise we might make our frame too small, see Bug#17077. */ | ||
| 5675 | int unit_width = FRAME_COLUMN_WIDTH (f); | 5679 | int unit_width = FRAME_COLUMN_WIDTH (f); |
| 5676 | int unit_height = FRAME_LINE_HEIGHT (f); | 5680 | int unit_height = FRAME_LINE_HEIGHT (f); |
| 5677 | 5681 | ||
| 5678 | pixelwidth = (pixelwidth / unit_width) * unit_width; | 5682 | pixelwidth = (((((pixelwise ? width : (width * FRAME_COLUMN_WIDTH (f))) |
| 5679 | pixelheight = (pixelheight / unit_height) * unit_height; | 5683 | + FRAME_TOTAL_FRINGE_WIDTH (f)) |
| 5684 | / unit_width) * unit_width) | ||
| 5685 | + FRAME_SCROLL_BAR_AREA_WIDTH (f) | ||
| 5686 | + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); | ||
| 5687 | |||
| 5688 | pixelheight = ((((pixelwise ? height : (height * FRAME_LINE_HEIGHT (f))) | ||
| 5689 | / unit_height) * unit_height) | ||
| 5690 | + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); | ||
| 5680 | } | 5691 | } |
| 5681 | 5692 | ||
| 5682 | f->win_gravity = NorthWestGravity; | 5693 | f->win_gravity = NorthWestGravity; |