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/pgtkfns.c | |
| 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/pgtkfns.c')
| -rw-r--r-- | src/pgtkfns.c | 17 |
1 files changed, 13 insertions, 4 deletions
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); |