diff options
| author | Martin Rudalics | 2022-01-24 10:33:15 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2022-01-24 10:33:15 +0100 |
| commit | 1575afe8df522a49184217632b2eb4f3d234942c (patch) | |
| tree | 22c4985095e2c913ec41dbf7885b75e50d27a2b4 /src | |
| parent | dee029e19ff1874e7483ccd3e5994bda6e3c7e5d (diff) | |
| download | emacs-1575afe8df522a49184217632b2eb4f3d234942c.tar.gz emacs-1575afe8df522a49184217632b2eb4f3d234942c.zip | |
Orderly inhibit frame resizing when activating tool or tab bar (Bug#52986)
* src/xdisp.c (redisplay_tab_bar, redisplay_tool_bar): If we do
not display a tool or tab bar in these functions, still set
f->tool/tab_bar_redisplayed and f->tool/tab_bar_resized. This
avoids that when one of these are initially turned off, a later
activation resizes the frame despite of the fact that
'frame-inhibit-implied-resize' should prevent it (Bug#52986).
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index af46d4da604..9c0764be690 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13928,6 +13928,8 @@ redisplay_tab_bar (struct frame *f) | |||
| 13928 | struct it it; | 13928 | struct it it; |
| 13929 | struct glyph_row *row; | 13929 | struct glyph_row *row; |
| 13930 | 13930 | ||
| 13931 | f->tab_bar_redisplayed = true; | ||
| 13932 | |||
| 13931 | /* If frame hasn't a tab-bar window or if it is zero-height, don't | 13933 | /* If frame hasn't a tab-bar window or if it is zero-height, don't |
| 13932 | do anything. This means you must start with tab-bar-lines | 13934 | do anything. This means you must start with tab-bar-lines |
| 13933 | non-zero to get the auto-sizing effect. Or in other words, you | 13935 | non-zero to get the auto-sizing effect. Or in other words, you |
| @@ -13935,9 +13937,16 @@ redisplay_tab_bar (struct frame *f) | |||
| 13935 | if (!WINDOWP (f->tab_bar_window) | 13937 | if (!WINDOWP (f->tab_bar_window) |
| 13936 | || (w = XWINDOW (f->tab_bar_window), | 13938 | || (w = XWINDOW (f->tab_bar_window), |
| 13937 | WINDOW_TOTAL_LINES (w) == 0)) | 13939 | WINDOW_TOTAL_LINES (w) == 0)) |
| 13938 | return false; | 13940 | { |
| 13941 | /* Even if we do not display a tab bar initially, still pretend | ||
| 13942 | that we have resized it. This avoids that a later activation | ||
| 13943 | of the tab bar resizes the frame, despite of the fact that the | ||
| 13944 | setting of 'frame-inhibit-implied-resize' should inhibit it | ||
| 13945 | (Bug#52986). */ | ||
| 13946 | f->tab_bar_resized = true; | ||
| 13939 | 13947 | ||
| 13940 | f->tab_bar_redisplayed = true; | 13948 | return false; |
| 13949 | } | ||
| 13941 | 13950 | ||
| 13942 | /* Set up an iterator for the tab-bar window. */ | 13951 | /* Set up an iterator for the tab-bar window. */ |
| 13943 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TAB_BAR_FACE_ID); | 13952 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TAB_BAR_FACE_ID); |
| @@ -14847,6 +14856,8 @@ redisplay_tool_bar (struct frame *f) | |||
| 14847 | struct it it; | 14856 | struct it it; |
| 14848 | struct glyph_row *row; | 14857 | struct glyph_row *row; |
| 14849 | 14858 | ||
| 14859 | f->tool_bar_redisplayed = true; | ||
| 14860 | |||
| 14850 | /* If frame hasn't a tool-bar window or if it is zero-height, don't | 14861 | /* If frame hasn't a tool-bar window or if it is zero-height, don't |
| 14851 | do anything. This means you must start with tool-bar-lines | 14862 | do anything. This means you must start with tool-bar-lines |
| 14852 | non-zero to get the auto-sizing effect. Or in other words, you | 14863 | non-zero to get the auto-sizing effect. Or in other words, you |
| @@ -14854,9 +14865,16 @@ redisplay_tool_bar (struct frame *f) | |||
| 14854 | if (!WINDOWP (f->tool_bar_window) | 14865 | if (!WINDOWP (f->tool_bar_window) |
| 14855 | || (w = XWINDOW (f->tool_bar_window), | 14866 | || (w = XWINDOW (f->tool_bar_window), |
| 14856 | WINDOW_TOTAL_LINES (w) == 0)) | 14867 | WINDOW_TOTAL_LINES (w) == 0)) |
| 14857 | return false; | 14868 | { |
| 14869 | /* Even if we do not display a tool bar initially, still pretend | ||
| 14870 | that we have resized it already. This avoids that a later | ||
| 14871 | activation of the tool bar resizes the frame, despite of the | ||
| 14872 | fact that a setting of 'frame-inhibit-implied-resize' should | ||
| 14873 | inhibit it (Bug#52986). */ | ||
| 14874 | f->tool_bar_resized = true; | ||
| 14858 | 14875 | ||
| 14859 | f->tool_bar_redisplayed = true; | 14876 | return false; |
| 14877 | } | ||
| 14860 | 14878 | ||
| 14861 | /* Set up an iterator for the tool-bar window. */ | 14879 | /* Set up an iterator for the tool-bar window. */ |
| 14862 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); | 14880 | init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); |