diff options
| author | Stefan Monnier | 2014-09-30 19:19:31 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-09-30 19:19:31 -0400 |
| commit | 07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de (patch) | |
| tree | 222adf06960f86aa8b2f560217d39c9fe39d3996 /src/w32term.c | |
| parent | 6aed001ad31d41f028d77e66e597b7b3ab4e31ae (diff) | |
| parent | d3b7a90bc2ad20192d1afd23eb1aa6a18ceda569 (diff) | |
| download | emacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.tar.gz emacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.zip | |
Merge from emacs-24
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 54 |
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, | |||
| 5144 | RECT rect; | 5144 | RECT rect; |
| 5145 | int rows, columns, width, height, text_width, text_height; | 5145 | int rows, columns, width, height, text_width, text_height; |
| 5146 | 5146 | ||
| 5147 | GetClientRect (msg.msg.hwnd, &rect); | 5147 | if (GetClientRect (msg.msg.hwnd, &rect) |
| 5148 | 5148 | /* GetClientRect evidently returns (0, 0, 0, 0) if | |
| 5149 | height = rect.bottom - rect.top; | 5149 | called on a minimized frame. Such "dimensions" |
| 5150 | width = rect.right - rect.left; | 5150 | aren't useful anyway. */ |
| 5151 | text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width); | 5151 | && !(rect.bottom == 0 |
| 5152 | text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height); | 5152 | && rect.top == 0 |
| 5153 | /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */ | 5153 | && rect.left == 0 |
| 5154 | /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */ | 5154 | && rect.right == 0)) |
| 5155 | |||
| 5156 | /* TODO: Clip size to the screen dimensions. */ | ||
| 5157 | |||
| 5158 | /* Even if the number of character rows and columns has | ||
| 5159 | not changed, the font size may have changed, so we need | ||
| 5160 | to check the pixel dimensions as well. */ | ||
| 5161 | |||
| 5162 | if (width != FRAME_PIXEL_WIDTH (f) | ||
| 5163 | || height != FRAME_PIXEL_HEIGHT (f) | ||
| 5164 | || text_width != FRAME_TEXT_WIDTH (f) | ||
| 5165 | || text_height != FRAME_TEXT_HEIGHT (f)) | ||
| 5166 | { | 5155 | { |
| 5167 | change_frame_size (f, text_width, text_height, 0, 1, 0, 1); | 5156 | height = rect.bottom - rect.top; |
| 5168 | SET_FRAME_GARBAGED (f); | 5157 | width = rect.right - rect.left; |
| 5169 | cancel_mouse_face (f); | 5158 | text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, width); |
| 5170 | f->win_gravity = NorthWestGravity; | 5159 | text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, height); |
| 5160 | /* rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height); */ | ||
| 5161 | /* columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width); */ | ||
| 5162 | |||
| 5163 | /* TODO: Clip size to the screen dimensions. */ | ||
| 5164 | |||
| 5165 | /* Even if the number of character rows and columns | ||
| 5166 | has not changed, the font size may have changed, | ||
| 5167 | so we need to check the pixel dimensions as well. */ | ||
| 5168 | |||
| 5169 | if (width != FRAME_PIXEL_WIDTH (f) | ||
| 5170 | || height != FRAME_PIXEL_HEIGHT (f) | ||
| 5171 | || text_width != FRAME_TEXT_WIDTH (f) | ||
| 5172 | || text_height != FRAME_TEXT_HEIGHT (f)) | ||
| 5173 | { | ||
| 5174 | change_frame_size (f, text_width, text_height, 0, 1, 0, 1); | ||
| 5175 | SET_FRAME_GARBAGED (f); | ||
| 5176 | cancel_mouse_face (f); | ||
| 5177 | f->win_gravity = NorthWestGravity; | ||
| 5178 | } | ||
| 5171 | } | 5179 | } |
| 5172 | } | 5180 | } |
| 5173 | 5181 | ||