Commit 5645852c authored by Martin Rudalics's avatar Martin Rudalics
Browse files

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).
parent 287d7076
2013-12-14 Martin Rudalics <rudalics@gmx.at>
* w32term.c (w32_enable_frame_resize_hack): New variable.
(x_set_window_size): Use it to hack frame resizing on Windows
(Bug#16028).
2013-12-14 Eli Zaretskii <eliz@gnu.org> 2013-12-14 Eli Zaretskii <eliz@gnu.org>
* fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the * fileio.c (Fcopy_file) [WINDOWSNT]: Move most of the
......
...@@ -5747,8 +5747,12 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b ...@@ -5747,8 +5747,12 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
} }
#if 0 /* If w32_enable_frame_resize_hack is non-nil, immediately apply the
/* The following mirrors what is done in xterm.c. It appears to be new pixel sizes to the frame and its subwindows. See discussion
of Bug#16028 for why we need this. */
if (w32_enable_frame_resize_hack)
/* The following mirrors what is done in xterm.c. It appears to be
for informing lisp of the new size immediately, while the actual for informing lisp of the new size immediately, while the actual
resize will happen asynchronously. But on Windows, the menu bar resize will happen asynchronously. But on Windows, the menu bar
automatically wraps when the frame is too narrow to contain it, 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,25 +5779,19 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
We pass 1 for DELAY since we can't run Lisp code inside of We pass 1 for DELAY since we can't run Lisp code inside of
a BLOCK_INPUT. */ a BLOCK_INPUT. */
change_frame_size (f, width, height, 0, 1, 0, 0); {
FRAME_PIXEL_WIDTH (f) = pixelwidth; change_frame_size (f, width, height, 0, 1, 0, pixelwise);
FRAME_PIXEL_HEIGHT (f) = pixelheight; SET_FRAME_GARBAGED (f);
/* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to /* If cursor was outside the new size, mark it as off. */
receive in the ConfigureNotify event; if we get what we asked mark_window_cursors_off (XWINDOW (f->root_window));
for, then the event won't cause the screen to become garbaged, so
we have to make sure to do it here. */ /* Clear out any recollection of where the mouse highlighting was,
SET_FRAME_GARBAGED (f); since it might be in a place that's outside the new frame size.
Actually checking whether it is outside is a pain in the neck,
/* If cursor was outside the new size, mark it as off. */ so don't try--just let the highlighting be done afresh with new size. */
mark_window_cursors_off (XWINDOW (f->root_window)); cancel_mouse_face (f);
}
/* Clear out any recollection of where the mouse highlighting was,
since it might be in a place that's outside the new frame size.
Actually checking whether it is outside is a pain in the neck,
so don't try--just let the highlighting be done afresh with new size. */
cancel_mouse_face (f);
#endif
unblock_input (); unblock_input ();
} }
...@@ -6673,6 +6671,16 @@ systems of the NT family, including W2K, XP, Vista, Windows 7 and ...@@ -6673,6 +6671,16 @@ systems of the NT family, including W2K, XP, Vista, Windows 7 and
Windows 8. It is set to nil on Windows 9X. */); Windows 8. It is set to nil on Windows 9X. */);
w32_unicode_filenames = 0; w32_unicode_filenames = 0;
DEFVAR_BOOL ("w32-enable-frame-resize-hack",
w32_enable_frame_resize_hack,
doc: /* Non-nil means enable hack for frame resizing on Windows.
A value of nil means to resize frames by sending a corresponding request
to the Windows API and changing the pixel sizes of the frame and its
windows after the latter calls back. If this is non-nil, Emacs changes
the pixel sizes of the frame and its windows at the time it sends the
resize request to the API. */);
w32_enable_frame_resize_hack = 0;
/* Tell Emacs about this window system. */ /* Tell Emacs about this window system. */
Fprovide (Qw32, Qnil); Fprovide (Qw32, Qnil);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment