diff options
| author | Martin Rudalics | 2013-12-14 12:06:00 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2013-12-14 12:06:00 +0100 |
| commit | 5645852c2eddc5a65e53be937817e12680194272 (patch) | |
| tree | a2631904cb84911d810c647b4ab123256ba88880 /src | |
| parent | 287d70764c83f6054eb2a0ede942eda01c20fcdf (diff) | |
| download | emacs-5645852c2eddc5a65e53be937817e12680194272.tar.gz emacs-5645852c2eddc5a65e53be937817e12680194272.zip | |
Hack frame resizing on Windows (Bug#16028).
* w32term.c (w32_enable_frame_resize_hack): New variable.
(x_set_window_size): Use it to hack frame resizing on Windows
(Bug#16028).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/w32term.c | 50 |
2 files changed, 35 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index df145600556..80367c81166 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-12-14 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * w32term.c (w32_enable_frame_resize_hack): New variable. | ||
| 4 | (x_set_window_size): Use it to hack frame resizing on Windows | ||
| 5 | (Bug#16028). | ||
| 6 | |||
| 1 | 2013-12-14 Eli Zaretskii <eliz@gnu.org> | 7 | 2013-12-14 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the | 9 | * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the |
diff --git a/src/w32term.c b/src/w32term.c index 3d6b653157b..6537b2205fe 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5747,8 +5747,12 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b | |||
| 5747 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); | 5747 | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); |
| 5748 | } | 5748 | } |
| 5749 | 5749 | ||
| 5750 | #if 0 | 5750 | /* If w32_enable_frame_resize_hack is non-nil, immediately apply the |
| 5751 | /* The following mirrors what is done in xterm.c. It appears to be | 5751 | new pixel sizes to the frame and its subwindows. See discussion |
| 5752 | of Bug#16028 for why we need this. */ | ||
| 5753 | |||
| 5754 | if (w32_enable_frame_resize_hack) | ||
| 5755 | /* The following mirrors what is done in xterm.c. It appears to be | ||
| 5752 | for informing lisp of the new size immediately, while the actual | 5756 | for informing lisp of the new size immediately, while the actual |
| 5753 | resize will happen asynchronously. But on Windows, the menu bar | 5757 | resize will happen asynchronously. But on Windows, the menu bar |
| 5754 | automatically wraps when the frame is too narrow to contain it, | 5758 | automatically wraps when the frame is too narrow to contain it, |
| @@ -5775,25 +5779,19 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b | |||
| 5775 | 5779 | ||
| 5776 | We pass 1 for DELAY since we can't run Lisp code inside of | 5780 | We pass 1 for DELAY since we can't run Lisp code inside of |
| 5777 | a BLOCK_INPUT. */ | 5781 | a BLOCK_INPUT. */ |
| 5778 | change_frame_size (f, width, height, 0, 1, 0, 0); | 5782 | { |
| 5779 | FRAME_PIXEL_WIDTH (f) = pixelwidth; | 5783 | change_frame_size (f, width, height, 0, 1, 0, pixelwise); |
| 5780 | FRAME_PIXEL_HEIGHT (f) = pixelheight; | 5784 | SET_FRAME_GARBAGED (f); |
| 5781 | 5785 | ||
| 5782 | /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to | 5786 | /* If cursor was outside the new size, mark it as off. */ |
| 5783 | receive in the ConfigureNotify event; if we get what we asked | 5787 | mark_window_cursors_off (XWINDOW (f->root_window)); |
| 5784 | for, then the event won't cause the screen to become garbaged, so | 5788 | |
| 5785 | we have to make sure to do it here. */ | 5789 | /* Clear out any recollection of where the mouse highlighting was, |
| 5786 | SET_FRAME_GARBAGED (f); | 5790 | since it might be in a place that's outside the new frame size. |
| 5787 | 5791 | Actually checking whether it is outside is a pain in the neck, | |
| 5788 | /* If cursor was outside the new size, mark it as off. */ | 5792 | so don't try--just let the highlighting be done afresh with new size. */ |
| 5789 | mark_window_cursors_off (XWINDOW (f->root_window)); | 5793 | cancel_mouse_face (f); |
| 5790 | 5794 | } | |
| 5791 | /* Clear out any recollection of where the mouse highlighting was, | ||
| 5792 | since it might be in a place that's outside the new frame size. | ||
| 5793 | Actually checking whether it is outside is a pain in the neck, | ||
| 5794 | so don't try--just let the highlighting be done afresh with new size. */ | ||
| 5795 | cancel_mouse_face (f); | ||
| 5796 | #endif | ||
| 5797 | 5795 | ||
| 5798 | unblock_input (); | 5796 | unblock_input (); |
| 5799 | } | 5797 | } |
| @@ -6673,6 +6671,16 @@ systems of the NT family, including W2K, XP, Vista, Windows 7 and | |||
| 6673 | Windows 8. It is set to nil on Windows 9X. */); | 6671 | Windows 8. It is set to nil on Windows 9X. */); |
| 6674 | w32_unicode_filenames = 0; | 6672 | w32_unicode_filenames = 0; |
| 6675 | 6673 | ||
| 6674 | DEFVAR_BOOL ("w32-enable-frame-resize-hack", | ||
| 6675 | w32_enable_frame_resize_hack, | ||
| 6676 | doc: /* Non-nil means enable hack for frame resizing on Windows. | ||
| 6677 | A value of nil means to resize frames by sending a corresponding request | ||
| 6678 | to the Windows API and changing the pixel sizes of the frame and its | ||
| 6679 | windows after the latter calls back. If this is non-nil, Emacs changes | ||
| 6680 | the pixel sizes of the frame and its windows at the time it sends the | ||
| 6681 | resize request to the API. */); | ||
| 6682 | w32_enable_frame_resize_hack = 0; | ||
| 6683 | |||
| 6676 | /* Tell Emacs about this window system. */ | 6684 | /* Tell Emacs about this window system. */ |
| 6677 | Fprovide (Qw32, Qnil); | 6685 | Fprovide (Qw32, Qnil); |
| 6678 | } | 6686 | } |