Mercurial > vim
comparison src/gui.c @ 10819:cd179d7d0b5d v8.0.0299
patch 8.0.0299: a window resize is sometimes not taking effect
commit https://github.com/vim/vim/commit/6b40f303291be6b2fe524b5708e089773048c269
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 3 22:01:47 2017 +0100
patch 8.0.0299: a window resize is sometimes not taking effect
Problem: When the GUI window is resized Vim does not always take over the
new size. (Luchr)
Solution: Reset new_p_guifont in gui_resize_shell(). Call
gui_may_resize_shell() in the main loop.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 03 Feb 2017 22:15:04 +0100 |
parents | 4aead6a9b7a9 |
children | 778c10516955 |
comparison
equal
deleted
inserted
replaced
10818:9892ae5794e3 | 10819:cd179d7d0b5d |
---|---|
1457 new_pixel_height = pixel_height; | 1457 new_pixel_height = pixel_height; |
1458 return; | 1458 return; |
1459 } | 1459 } |
1460 | 1460 |
1461 again: | 1461 again: |
1462 new_pixel_width = 0; | |
1463 new_pixel_height = 0; | |
1462 busy = TRUE; | 1464 busy = TRUE; |
1463 | 1465 |
1464 /* Flush pending output before redrawing */ | 1466 /* Flush pending output before redrawing */ |
1465 out_flush(); | 1467 out_flush(); |
1466 | 1468 |
1467 gui.num_cols = (pixel_width - gui_get_base_width()) / gui.char_width; | 1469 gui.num_cols = (pixel_width - gui_get_base_width()) / gui.char_width; |
1468 gui.num_rows = (pixel_height - gui_get_base_height()) / gui.char_height; | 1470 gui.num_rows = (pixel_height - gui_get_base_height()) / gui.char_height; |
1469 | 1471 |
1470 gui_position_components(pixel_width); | 1472 gui_position_components(pixel_width); |
1471 | |
1472 gui_reset_scroll_region(); | 1473 gui_reset_scroll_region(); |
1474 | |
1473 /* | 1475 /* |
1474 * At the "more" and ":confirm" prompt there is no redraw, put the cursor | 1476 * At the "more" and ":confirm" prompt there is no redraw, put the cursor |
1475 * at the last line here (why does it have to be one row too low?). | 1477 * at the last line here (why does it have to be one row too low?). |
1476 */ | 1478 */ |
1477 if (State == ASKMORE || State == CONFIRM) | 1479 if (State == ASKMORE || State == CONFIRM) |
1489 xim_set_status_area(); | 1491 xim_set_status_area(); |
1490 #endif | 1492 #endif |
1491 | 1493 |
1492 busy = FALSE; | 1494 busy = FALSE; |
1493 | 1495 |
1494 /* | 1496 /* We may have been called again while redrawing the screen. |
1495 * We could have been called again while redrawing the screen. | 1497 * Need to do it all again with the latest size then. But only if the size |
1496 * Need to do it all again with the latest size then. | 1498 * actually changed. */ |
1497 */ | |
1498 if (new_pixel_height) | 1499 if (new_pixel_height) |
1499 { | 1500 { |
1500 pixel_width = new_pixel_width; | 1501 if (pixel_width == new_pixel_width && pixel_height == new_pixel_height) |
1501 pixel_height = new_pixel_height; | 1502 { |
1502 new_pixel_width = 0; | 1503 new_pixel_width = 0; |
1503 new_pixel_height = 0; | 1504 new_pixel_height = 0; |
1504 goto again; | 1505 } |
1506 else | |
1507 { | |
1508 pixel_width = new_pixel_width; | |
1509 pixel_height = new_pixel_height; | |
1510 goto again; | |
1511 } | |
1505 } | 1512 } |
1506 } | 1513 } |
1507 | 1514 |
1508 /* | 1515 /* |
1509 * Check if gui_resize_shell() must be called. | 1516 * Check if gui_resize_shell() must be called. |
1510 */ | 1517 */ |
1511 void | 1518 void |
1512 gui_may_resize_shell(void) | 1519 gui_may_resize_shell(void) |
1513 { | 1520 { |
1514 int h, w; | |
1515 | |
1516 if (new_pixel_height) | 1521 if (new_pixel_height) |
1517 { | |
1518 /* careful: gui_resize_shell() may postpone the resize again if we | 1522 /* careful: gui_resize_shell() may postpone the resize again if we |
1519 * were called indirectly by it */ | 1523 * were called indirectly by it */ |
1520 w = new_pixel_width; | 1524 gui_resize_shell(new_pixel_width, new_pixel_height); |
1521 h = new_pixel_height; | |
1522 new_pixel_width = 0; | |
1523 new_pixel_height = 0; | |
1524 gui_resize_shell(w, h); | |
1525 } | |
1526 } | 1525 } |
1527 | 1526 |
1528 int | 1527 int |
1529 gui_get_shellsize(void) | 1528 gui_get_shellsize(void) |
1530 { | 1529 { |