diff options
| author | Po Lu | 2022-11-16 11:19:20 +0800 |
|---|---|---|
| committer | Po Lu | 2022-11-16 11:19:20 +0800 |
| commit | 690f7ac86ad9a9d714b1107d05c5e856a43bb18d (patch) | |
| tree | 0d10531953e9a3cffb92f1312fb4905a8fd0f897 /src | |
| parent | 0600065ff276d5c55c3ff2f466dfbce74586164f (diff) | |
| download | emacs-690f7ac86ad9a9d714b1107d05c5e856a43bb18d.tar.gz emacs-690f7ac86ad9a9d714b1107d05c5e856a43bb18d.zip | |
Fix calculation of tab bar lines during automatic height adjustment
* src/haikufns.c (haiku_change_tab_bar_height):
* src/nsfns.m (ns_change_tab_bar_height):
* src/pgtkfns.c (pgtk_change_tab_bar_height):
* src/w32fns.c (w32_change_tab_bar_height):
* src/xfns.c (x_change_tab_bar_height): Do not round tab bar
height up. (bug#59285, bug#59271)
Diffstat (limited to 'src')
| -rw-r--r-- | src/haikufns.c | 17 | ||||
| -rw-r--r-- | src/nsfns.m | 17 | ||||
| -rw-r--r-- | src/pgtkfns.c | 17 | ||||
| -rw-r--r-- | src/w32fns.c | 17 | ||||
| -rw-r--r-- | src/xfns.c | 17 |
5 files changed, 65 insertions, 20 deletions
diff --git a/src/haikufns.c b/src/haikufns.c index 711202c5df3..5717d0354f8 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -175,10 +175,19 @@ haiku_change_tool_bar_height (struct frame *f, int height) | |||
| 175 | void | 175 | void |
| 176 | haiku_change_tab_bar_height (struct frame *f, int height) | 176 | haiku_change_tab_bar_height (struct frame *f, int height) |
| 177 | { | 177 | { |
| 178 | int unit = FRAME_LINE_HEIGHT (f); | 178 | int unit, old_height, lines; |
| 179 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | 179 | Lisp_Object fullscreen; |
| 180 | int lines = (height + unit - 1) / unit; | 180 | |
| 181 | Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); | 181 | unit = FRAME_LINE_HEIGHT (f); |
| 182 | old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 183 | fullscreen = get_frame_param (f, Qfullscreen); | ||
| 184 | |||
| 185 | /* This differs from the tool bar code in that the tab bar height is | ||
| 186 | not rounded up. Otherwise, if redisplay_tab_bar decides to grow | ||
| 187 | the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, | ||
| 188 | leading to the tab bar height being incorrectly set upon the next | ||
| 189 | call to x_set_font. (bug#59285) */ | ||
| 190 | lines = height / unit; | ||
| 182 | 191 | ||
| 183 | /* Make sure we redisplay all windows in this frame. */ | 192 | /* Make sure we redisplay all windows in this frame. */ |
| 184 | fset_redisplay (f); | 193 | fset_redisplay (f); |
diff --git a/src/nsfns.m b/src/nsfns.m index 2699cf37a5b..d793bcf13ff 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -632,10 +632,19 @@ ns_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 632 | void | 632 | void |
| 633 | ns_change_tab_bar_height (struct frame *f, int height) | 633 | ns_change_tab_bar_height (struct frame *f, int height) |
| 634 | { | 634 | { |
| 635 | int unit = FRAME_LINE_HEIGHT (f); | 635 | int unit, old_height, lines; |
| 636 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | 636 | Lisp_Object fullscreen; |
| 637 | int lines = (height + unit - 1) / unit; | 637 | |
| 638 | Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); | 638 | unit = FRAME_LINE_HEIGHT (f); |
| 639 | old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 640 | fullscreen = get_frame_param (f, Qfullscreen); | ||
| 641 | |||
| 642 | /* This differs from the tool bar code in that the tab bar height is | ||
| 643 | not rounded up. Otherwise, if redisplay_tab_bar decides to grow | ||
| 644 | the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, | ||
| 645 | leading to the tab bar height being incorrectly set upon the next | ||
| 646 | call to x_set_font. (bug#59285) */ | ||
| 647 | lines = height / unit; | ||
| 639 | 648 | ||
| 640 | /* Make sure we redisplay all windows in this frame. */ | 649 | /* Make sure we redisplay all windows in this frame. */ |
| 641 | fset_redisplay (f); | 650 | fset_redisplay (f); |
diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 9473e14f5cf..f370f039780 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c | |||
| @@ -473,10 +473,19 @@ pgtk_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 473 | void | 473 | void |
| 474 | pgtk_change_tab_bar_height (struct frame *f, int height) | 474 | pgtk_change_tab_bar_height (struct frame *f, int height) |
| 475 | { | 475 | { |
| 476 | int unit = FRAME_LINE_HEIGHT (f); | 476 | int unit, old_height, lines; |
| 477 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | 477 | Lisp_Object fullscreen; |
| 478 | int lines = (height + unit - 1) / unit; | 478 | |
| 479 | Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); | 479 | unit = FRAME_LINE_HEIGHT (f); |
| 480 | old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 481 | fullscreen = get_frame_param (f, Qfullscreen); | ||
| 482 | |||
| 483 | /* This differs from the tool bar code in that the tab bar height is | ||
| 484 | not rounded up. Otherwise, if redisplay_tab_bar decides to grow | ||
| 485 | the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, | ||
| 486 | leading to the tab bar height being incorrectly set upon the next | ||
| 487 | call to x_set_font. (bug#59285) */ | ||
| 488 | lines = height / unit; | ||
| 480 | 489 | ||
| 481 | /* Make sure we redisplay all windows in this frame. */ | 490 | /* Make sure we redisplay all windows in this frame. */ |
| 482 | fset_redisplay (f); | 491 | fset_redisplay (f); |
diff --git a/src/w32fns.c b/src/w32fns.c index c7eddcba6de..e441665804e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -1717,10 +1717,19 @@ w32_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 1717 | void | 1717 | void |
| 1718 | w32_change_tab_bar_height (struct frame *f, int height) | 1718 | w32_change_tab_bar_height (struct frame *f, int height) |
| 1719 | { | 1719 | { |
| 1720 | int unit = FRAME_LINE_HEIGHT (f); | 1720 | int unit, old_height, lines; |
| 1721 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | 1721 | Lisp_Object fullscreen; |
| 1722 | int lines = (height + unit - 1) / unit; | 1722 | |
| 1723 | Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); | 1723 | unit = FRAME_LINE_HEIGHT (f); |
| 1724 | old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 1725 | fullscreen = get_frame_param (f, Qfullscreen); | ||
| 1726 | |||
| 1727 | /* This differs from the tool bar code in that the tab bar height is | ||
| 1728 | not rounded up. Otherwise, if redisplay_tab_bar decides to grow | ||
| 1729 | the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, | ||
| 1730 | leading to the tab bar height being incorrectly set upon the next | ||
| 1731 | call to x_set_font. (bug#59285) */ | ||
| 1732 | lines = height / unit; | ||
| 1724 | 1733 | ||
| 1725 | /* Make sure we redisplay all windows in this frame. */ | 1734 | /* Make sure we redisplay all windows in this frame. */ |
| 1726 | fset_redisplay (f); | 1735 | fset_redisplay (f); |
diff --git a/src/xfns.c b/src/xfns.c index 6bd613ba692..8ee26d713aa 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1750,10 +1750,19 @@ x_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 1750 | void | 1750 | void |
| 1751 | x_change_tab_bar_height (struct frame *f, int height) | 1751 | x_change_tab_bar_height (struct frame *f, int height) |
| 1752 | { | 1752 | { |
| 1753 | int unit = FRAME_LINE_HEIGHT (f); | 1753 | int unit, old_height, lines; |
| 1754 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | 1754 | Lisp_Object fullscreen; |
| 1755 | int lines = (height + unit - 1) / unit; | 1755 | |
| 1756 | Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); | 1756 | unit = FRAME_LINE_HEIGHT (f); |
| 1757 | old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 1758 | fullscreen = get_frame_param (f, Qfullscreen); | ||
| 1759 | |||
| 1760 | /* This differs from the tool bar code in that the tab bar height is | ||
| 1761 | not rounded up. Otherwise, if redisplay_tab_bar decides to grow | ||
| 1762 | the tab bar by even 1 pixel, FRAME_TAB_BAR_LINES will be changed, | ||
| 1763 | leading to the tab bar height being incorrectly set upon the next | ||
| 1764 | call to x_set_font. (bug#59285) */ | ||
| 1765 | lines = height / unit; | ||
| 1757 | 1766 | ||
| 1758 | /* Make sure we redisplay all windows in this frame. */ | 1767 | /* Make sure we redisplay all windows in this frame. */ |
| 1759 | fset_redisplay (f); | 1768 | fset_redisplay (f); |