/* No menu bar for child frames. */
store_frame_param (f, Qmenu_bar_lines, make_fixnum (0));
+ gui_default_parameter (f, parameters, Qtab_bar_lines,
+ NILP (Vtab_bar_mode)
+ ? make_fixnum (0) : make_fixnum (1),
+ NULL, NULL, RES_TYPE_NUMBER);
+
gui_default_parameter (f, parameters, Qtool_bar_lines,
NILP (Vtool_bar_mode)
? make_fixnum (0) : make_fixnum (1),
`menu-bar-size' is a cons of the width and height of the menu bar of
FRAME.
+`tab-bar-size' is a cons of the width and height of the tab bar of
+ FRAME.
+
`tool-bar-external', if non-nil, means the tool bar is external (never
included in the inner edges of FRAME).
unsigned int external_border_width, external_border_height;
int title_bar_width = 0, title_bar_height = 0;
int single_menu_bar_height, wrapped_menu_bar_height, menu_bar_height;
+ int tab_bar_height = FRAME_TAB_BAR_HEIGHT (f);
int tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f);
int internal_border_width = FRAME_INTERNAL_BORDER_WIDTH (f);
Fcons (make_fixnum
(menu_bar.rcBar.right - menu_bar.rcBar.left),
make_fixnum (menu_bar_height))),
+ Fcons (Qtab_bar_size,
+ Fcons (make_fixnum
+ (tab_bar_height
+ ? (right - left - 2 * external_border_width
+ - 2 * internal_border_width)
+ : 0),
+ make_fixnum (tab_bar_height))),
Fcons (Qtool_bar_external, Qnil),
Fcons (Qtool_bar_position, tool_bar_height ? Qtop : Qnil),
Fcons (Qtool_bar_size,
return list4 (make_fixnum (left + internal_border_width),
make_fixnum (top
+ + FRAME_TAB_BAR_HEIGHT (f)
+ FRAME_TOOL_BAR_HEIGHT (f)
+ internal_border_width),
make_fixnum (right - internal_border_width),
int w32_message_fd = -1;
#endif /* CYGWIN */
+static void w32_handle_tab_bar_click (struct frame *,
+ struct input_event *);
static void w32_handle_tool_bar_click (struct frame *,
struct input_event *);
static void w32_define_cursor (Window, Emacs_Cursor);
unblock_input ();
}
+\f
+/***********************************************************************
+ Tab-bars
+ ***********************************************************************/
+
+/* Handle mouse button event on the tab-bar of frame F, at
+ frame-relative coordinates X/Y. EVENT_TYPE is either ButtonPress
+ or ButtonRelease. */
+
+static void
+w32_handle_tab_bar_click (struct frame *f, struct input_event *button_event)
+{
+ int x = XFIXNAT (button_event->x);
+ int y = XFIXNAT (button_event->y);
+
+ if (button_event->modifiers & down_modifier)
+ handle_tab_bar_click (f, x, y, 1, 0);
+ else
+ handle_tab_bar_click (f, x, y, 0,
+ button_event->modifiers & ~up_modifier);
+}
+
+
\f
/***********************************************************************
Tool-bars
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight)
+ && !EQ (f->tab_bar_window, hlinfo->mouse_face_window)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight)
+ && !EQ (f->tab_bar_window, hlinfo->mouse_face_window)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight)
+ && !EQ (f->tab_bar_window, hlinfo->mouse_face_window)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
{
clear_mouse_face (hlinfo);
{
/* If we decide we want to generate an event to be seen
by the rest of Emacs, we put it here. */
+ bool tab_bar_p = 0;
bool tool_bar_p = 0;
int button = 0;
int up = 0;
{
w32_construct_mouse_click (&inev, &msg, f);
+ /* Is this in the tab-bar? */
+ if (WINDOWP (f->tab_bar_window)
+ && WINDOW_TOTAL_LINES (XWINDOW (f->tab_bar_window)))
+ {
+ Lisp_Object window;
+ int x = XFIXNAT (inev.x);
+ int y = XFIXNAT (inev.y);
+
+ window = window_from_coordinates (f, x, y, 0, 1, 0);
+
+ if (EQ (window, f->tab_bar_window))
+ {
+ w32_handle_tab_bar_click (f, &inev);
+ tab_bar_p = 1;
+ }
+ }
+
+ if (tab_bar_p
+ || (dpyinfo->w32_focus_frame
+ && f != dpyinfo->w32_focus_frame
+ /* This does not help when the click happens in
+ a grand-parent frame. */
+ && !frame_ancestor_p (f, dpyinfo->w32_focus_frame)))
+ inev.kind = NO_EVENT;
+
/* Is this in the tool-bar? */
if (WINDOWP (f->tool_bar_window)
&& WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window)))
if (f != 0)
{
f->mouse_moved = false;
+ if (!tab_bar_p)
+ f->last_tab_bar_item = -1;
if (!tool_bar_p)
f->last_tool_bar_item = -1;
}
event; any subsequent mouse-movement Emacs events
should reflect only motion after the ButtonPress. */
f->mouse_moved = false;
+ f->last_tab_bar_item = -1;
f->last_tool_bar_item = -1;
dpyinfo->last_mouse_frame = f;
}
{
w32_construct_mouse_wheel (&inev, &msg, f1);
f1->mouse_moved = false;
+ f1->last_tab_bar_item = -1;
f1->last_tool_bar_item = -1;
dpyinfo->last_mouse_frame = f1;
}