summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-09-30 19:19:31 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-09-30 19:19:31 -0400
commit07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de (patch)
tree222adf06960f86aa8b2f560217d39c9fe39d3996 /src/w32term.c
parent6aed001ad31d41f028d77e66e597b7b3ab4e31ae (diff)
parentd3b7a90bc2ad20192d1afd23eb1aa6a18ceda569 (diff)
downloademacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.tar.gz
Merge from emacs-24
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 4f8482736c3..2a4c30af12d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5144,30 +5144,38 @@ w32_read_socket (struct terminal *terminal,
RECT rect;
int rows, columns, width, height, text_width, text_height;
- GetClientRect (msg.msg.hwnd, &rect);
-
- height = rect.bottom - rect.top;
- width = rect.right - rect.left;
- text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width);
- text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height);
- /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */
- /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */
-
- /* TODO: Clip size to the screen dimensions. */
-
- /* Even if the number of character rows and columns has
- not changed, the font size may have changed, so we need
- to check the pixel dimensions as well. */
-
- if (width != FRAME_PIXEL_WIDTH (f)
- || height != FRAME_PIXEL_HEIGHT (f)
- || text_width != FRAME_TEXT_WIDTH (f)
- || text_height != FRAME_TEXT_HEIGHT (f))
+ if (GetClientRect (msg.msg.hwnd, &rect)
+ /* GetClientRect evidently returns (0, 0, 0, 0) if
+ called on a minimized frame. Such "dimensions"
+ aren't useful anyway. */
+ && !(rect.bottom == 0
+ && rect.top == 0
+ && rect.left == 0
+ && rect.right == 0))
{
- change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
- SET_FRAME_GARBAGED (f);
- cancel_mouse_face (f);
- f->win_gravity = NorthWestGravity;
+ height = rect.bottom - rect.top;
+ width = rect.right - rect.left;
+ text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width);
+ text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height);
+ /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */
+ /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */
+
+ /* TODO: Clip size to the screen dimensions. */
+
+ /* Even if the number of character rows and columns
+ has not changed, the font size may have changed,
+ so we need to check the pixel dimensions as well. */
+
+ if (width != FRAME_PIXEL_WIDTH (f)
+ || height != FRAME_PIXEL_HEIGHT (f)
+ || text_width != FRAME_TEXT_WIDTH (f)
+ || text_height != FRAME_TEXT_HEIGHT (f))
+ {
+ change_frame_size (f, text_width, text_height, 0, 1, 0, 1);
+ SET_FRAME_GARBAGED (f);
+ cancel_mouse_face (f);
+ f->win_gravity = NorthWestGravity;
+ }
}
}