Commit 7eeda50a authored by Martin Rudalics's avatar Martin Rudalics Committed by Juri Linkov

Fixes to build on Windows

* src/w32fns.c (w32_set_tab_bar_lines, w32_change_tab_bar_height):
New functions.

* src/w32term.c (w32_create_terminal): Set change_tab_bar_height_hook
to w32_change_tab_bar_height.
parent 47da92bd
......@@ -1773,6 +1773,94 @@ w32_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
}
/* Set the number of lines used for the tab bar of frame F to VALUE.
VALUE not an integer, or < 0 means set the lines to zero. OLDVAL
is the old number of tab bar lines. This function changes the
height of all windows on frame F to match the new tab bar height.
The frame's height doesn't change. */
static void
w32_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
{
int nlines;
/* Treat tab bars like menu bars. */
if (FRAME_MINIBUF_ONLY_P (f))
return;
/* Use VALUE only if an int >= 0. */
if (RANGED_FIXNUMP (0, value, INT_MAX))
nlines = XFIXNAT (value);
else
nlines = 0;
w32_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
}
/* Set the pixel height of the tab bar of frame F to HEIGHT. */
void
w32_change_tab_bar_height (struct frame *f, int height)
{
int unit = FRAME_LINE_HEIGHT (f);
int old_height = FRAME_TAB_BAR_HEIGHT (f);
int lines = (height + unit - 1) / unit;
Lisp_Object fullscreen;
/* Make sure we redisplay all windows in this frame. */
fset_redisplay (f);
/* Recalculate tab bar and frame text sizes. */
FRAME_TAB_BAR_HEIGHT (f) = height;
FRAME_TAB_BAR_LINES (f) = lines;
/* Store the `tab-bar-lines' and `height' frame parameters. */
store_frame_param (f, Qtab_bar_lines, make_fixnum (lines));
store_frame_param (f, Qheight, make_fixnum (FRAME_LINES (f)));
/* We also have to make sure that the internal border at the top of
the frame, below the menu bar or tab bar, is redrawn when the
tab bar disappears. This is so because the internal border is
below the tab bar if one is displayed, but is below the menu bar
if there isn't a tab bar. The tab bar draws into the area
below the menu bar. */
if (FRAME_W32_WINDOW (f) && FRAME_TAB_BAR_HEIGHT (f) == 0)
{
clear_frame (f);
clear_current_matrices (f);
}
if ((height < old_height) && WINDOWP (f->tab_bar_window))
clear_glyph_matrix (XWINDOW (f->tab_bar_window)->current_matrix);
/* Recalculate tabbar height. */
f->n_tab_bar_rows = 0;
if (old_height == 0
&& (!f->after_make_frame
|| NILP (frame_inhibit_implied_resize)
|| (CONSP (frame_inhibit_implied_resize)
&& NILP (Fmemq (Qtab_bar_lines, frame_inhibit_implied_resize)))))
f->tab_bar_redisplayed = f->tab_bar_resized = false;
adjust_frame_size (f, -1, -1,
((!f->tab_bar_resized
&& (NILP (fullscreen =
get_frame_param (f, Qfullscreen))
|| EQ (fullscreen, Qfullwidth))) ? 1
: (old_height == 0 || height == 0) ? 2
: 4),
false, Qtab_bar_lines);
f->tab_bar_resized = f->tab_bar_redisplayed;
/* adjust_frame_size might not have done anything, garbage frame
here. */
adjust_frame_glyphs (f);
SET_FRAME_GARBAGED (f);
if (FRAME_W32_WINDOW (f))
w32_clear_under_internal_border (f);
}
/* Set the number of lines used for the tool bar of frame F to VALUE.
VALUE not an integer, or < 0 means set the lines to zero. OLDVAL is
the old number of tool bar lines (and is unused). This function may
......
......@@ -7192,6 +7192,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
terminal->menu_show_hook = w32_menu_show;
terminal->activate_menubar_hook = w32_activate_menubar;
terminal->popup_dialog_hook = w32_popup_dialog;
terminal->change_tab_bar_height_hook = w32_change_tab_bar_height;
terminal->change_tool_bar_height_hook = w32_change_tool_bar_height;
terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
terminal->set_horizontal_scroll_bar_hook = w32_set_horizontal_scroll_bar;
......
......@@ -233,6 +233,7 @@ extern void w32_real_positions (struct frame *f, int *xptr, int *yptr);
extern void w32_clear_under_internal_border (struct frame *);
extern void w32_change_tab_bar_height (struct frame *, int);
extern void w32_change_tool_bar_height (struct frame *, int);
extern void w32_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
extern void w32_set_scroll_bar_default_width (struct frame *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment