diff options
| -rw-r--r-- | src/w32fns.c | 88 | ||||
| -rw-r--r-- | src/w32term.c | 1 | ||||
| -rw-r--r-- | src/w32term.h | 1 |
3 files changed, 90 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 4b95b255f1c..0d6369461cd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -1773,6 +1773,94 @@ w32_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 1773 | } | 1773 | } |
| 1774 | 1774 | ||
| 1775 | 1775 | ||
| 1776 | /* Set the number of lines used for the tab bar of frame F to VALUE. | ||
| 1777 | VALUE not an integer, or < 0 means set the lines to zero. OLDVAL | ||
| 1778 | is the old number of tab bar lines. This function changes the | ||
| 1779 | height of all windows on frame F to match the new tab bar height. | ||
| 1780 | The frame's height doesn't change. */ | ||
| 1781 | |||
| 1782 | static void | ||
| 1783 | w32_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | ||
| 1784 | { | ||
| 1785 | int nlines; | ||
| 1786 | |||
| 1787 | /* Treat tab bars like menu bars. */ | ||
| 1788 | if (FRAME_MINIBUF_ONLY_P (f)) | ||
| 1789 | return; | ||
| 1790 | |||
| 1791 | /* Use VALUE only if an int >= 0. */ | ||
| 1792 | if (RANGED_FIXNUMP (0, value, INT_MAX)) | ||
| 1793 | nlines = XFIXNAT (value); | ||
| 1794 | else | ||
| 1795 | nlines = 0; | ||
| 1796 | |||
| 1797 | w32_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); | ||
| 1798 | } | ||
| 1799 | |||
| 1800 | |||
| 1801 | /* Set the pixel height of the tab bar of frame F to HEIGHT. */ | ||
| 1802 | void | ||
| 1803 | w32_change_tab_bar_height (struct frame *f, int height) | ||
| 1804 | { | ||
| 1805 | int unit = FRAME_LINE_HEIGHT (f); | ||
| 1806 | int old_height = FRAME_TAB_BAR_HEIGHT (f); | ||
| 1807 | int lines = (height + unit - 1) / unit; | ||
| 1808 | Lisp_Object fullscreen; | ||
| 1809 | |||
| 1810 | /* Make sure we redisplay all windows in this frame. */ | ||
| 1811 | fset_redisplay (f); | ||
| 1812 | |||
| 1813 | /* Recalculate tab bar and frame text sizes. */ | ||
| 1814 | FRAME_TAB_BAR_HEIGHT (f) = height; | ||
| 1815 | FRAME_TAB_BAR_LINES (f) = lines; | ||
| 1816 | /* Store the `tab-bar-lines' and `height' frame parameters. */ | ||
| 1817 | store_frame_param (f, Qtab_bar_lines, make_fixnum (lines)); | ||
| 1818 | store_frame_param (f, Qheight, make_fixnum (FRAME_LINES (f))); | ||
| 1819 | |||
| 1820 | /* We also have to make sure that the internal border at the top of | ||
| 1821 | the frame, below the menu bar or tab bar, is redrawn when the | ||
| 1822 | tab bar disappears. This is so because the internal border is | ||
| 1823 | below the tab bar if one is displayed, but is below the menu bar | ||
| 1824 | if there isn't a tab bar. The tab bar draws into the area | ||
| 1825 | below the menu bar. */ | ||
| 1826 | if (FRAME_W32_WINDOW (f) && FRAME_TAB_BAR_HEIGHT (f) == 0) | ||
| 1827 | { | ||
| 1828 | clear_frame (f); | ||
| 1829 | clear_current_matrices (f); | ||
| 1830 | } | ||
| 1831 | |||
| 1832 | if ((height < old_height) && WINDOWP (f->tab_bar_window)) | ||
| 1833 | clear_glyph_matrix (XWINDOW (f->tab_bar_window)->current_matrix); | ||
| 1834 | |||
| 1835 | /* Recalculate tabbar height. */ | ||
| 1836 | f->n_tab_bar_rows = 0; | ||
| 1837 | if (old_height == 0 | ||
| 1838 | && (!f->after_make_frame | ||
| 1839 | || NILP (frame_inhibit_implied_resize) | ||
| 1840 | || (CONSP (frame_inhibit_implied_resize) | ||
| 1841 | && NILP (Fmemq (Qtab_bar_lines, frame_inhibit_implied_resize))))) | ||
| 1842 | f->tab_bar_redisplayed = f->tab_bar_resized = false; | ||
| 1843 | |||
| 1844 | adjust_frame_size (f, -1, -1, | ||
| 1845 | ((!f->tab_bar_resized | ||
| 1846 | && (NILP (fullscreen = | ||
| 1847 | get_frame_param (f, Qfullscreen)) | ||
| 1848 | || EQ (fullscreen, Qfullwidth))) ? 1 | ||
| 1849 | : (old_height == 0 || height == 0) ? 2 | ||
| 1850 | : 4), | ||
| 1851 | false, Qtab_bar_lines); | ||
| 1852 | |||
| 1853 | f->tab_bar_resized = f->tab_bar_redisplayed; | ||
| 1854 | |||
| 1855 | /* adjust_frame_size might not have done anything, garbage frame | ||
| 1856 | here. */ | ||
| 1857 | adjust_frame_glyphs (f); | ||
| 1858 | SET_FRAME_GARBAGED (f); | ||
| 1859 | if (FRAME_W32_WINDOW (f)) | ||
| 1860 | w32_clear_under_internal_border (f); | ||
| 1861 | } | ||
| 1862 | |||
| 1863 | |||
| 1776 | /* Set the number of lines used for the tool bar of frame F to VALUE. | 1864 | /* Set the number of lines used for the tool bar of frame F to VALUE. |
| 1777 | VALUE not an integer, or < 0 means set the lines to zero. OLDVAL is | 1865 | VALUE not an integer, or < 0 means set the lines to zero. OLDVAL is |
| 1778 | the old number of tool bar lines (and is unused). This function may | 1866 | the old number of tool bar lines (and is unused). This function may |
diff --git a/src/w32term.c b/src/w32term.c index 82c7e211bfd..1f57635f6db 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -7192,6 +7192,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo) | |||
| 7192 | terminal->menu_show_hook = w32_menu_show; | 7192 | terminal->menu_show_hook = w32_menu_show; |
| 7193 | terminal->activate_menubar_hook = w32_activate_menubar; | 7193 | terminal->activate_menubar_hook = w32_activate_menubar; |
| 7194 | terminal->popup_dialog_hook = w32_popup_dialog; | 7194 | terminal->popup_dialog_hook = w32_popup_dialog; |
| 7195 | terminal->change_tab_bar_height_hook = w32_change_tab_bar_height; | ||
| 7195 | terminal->change_tool_bar_height_hook = w32_change_tool_bar_height; | 7196 | terminal->change_tool_bar_height_hook = w32_change_tool_bar_height; |
| 7196 | terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; | 7197 | terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; |
| 7197 | terminal->set_horizontal_scroll_bar_hook = w32_set_horizontal_scroll_bar; | 7198 | terminal->set_horizontal_scroll_bar_hook = w32_set_horizontal_scroll_bar; |
diff --git a/src/w32term.h b/src/w32term.h index 6133e100c17..378f274d7ed 100644 --- a/src/w32term.h +++ b/src/w32term.h | |||
| @@ -233,6 +233,7 @@ extern void w32_real_positions (struct frame *f, int *xptr, int *yptr); | |||
| 233 | 233 | ||
| 234 | extern void w32_clear_under_internal_border (struct frame *); | 234 | extern void w32_clear_under_internal_border (struct frame *); |
| 235 | 235 | ||
| 236 | extern void w32_change_tab_bar_height (struct frame *, int); | ||
| 236 | extern void w32_change_tool_bar_height (struct frame *, int); | 237 | extern void w32_change_tool_bar_height (struct frame *, int); |
| 237 | extern void w32_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); | 238 | extern void w32_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); |
| 238 | extern void w32_set_scroll_bar_default_width (struct frame *); | 239 | extern void w32_set_scroll_bar_default_width (struct frame *); |