aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c63
1 files changed, 52 insertions, 11 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 255b6c62d5a..5baa29a8466 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3220,9 +3220,11 @@ x_draw_image_relief (struct glyph_string *s)
3220 if (s->hl == DRAW_IMAGE_SUNKEN 3220 if (s->hl == DRAW_IMAGE_SUNKEN
3221 || s->hl == DRAW_IMAGE_RAISED) 3221 || s->hl == DRAW_IMAGE_RAISED)
3222 { 3222 {
3223 thick = (tool_bar_button_relief < 0 3223 thick = (tab_bar_button_relief < 0
3224 ? DEFAULT_TOOL_BAR_BUTTON_RELIEF 3224 ? DEFAULT_TAB_BAR_BUTTON_RELIEF
3225 : min (tool_bar_button_relief, 1000000)); 3225 : (tool_bar_button_relief < 0
3226 ? DEFAULT_TOOL_BAR_BUTTON_RELIEF
3227 : min (tool_bar_button_relief, 1000000)));
3226 raised_p = s->hl == DRAW_IMAGE_RAISED; 3228 raised_p = s->hl == DRAW_IMAGE_RAISED;
3227 } 3229 }
3228 else 3230 else
@@ -3235,6 +3237,19 @@ x_draw_image_relief (struct glyph_string *s)
3235 y1 = y + s->slice.height - 1; 3237 y1 = y + s->slice.height - 1;
3236 3238
3237 extra_x = extra_y = 0; 3239 extra_x = extra_y = 0;
3240 if (s->face->id == TAB_BAR_FACE_ID)
3241 {
3242 if (CONSP (Vtab_bar_button_margin)
3243 && FIXNUMP (XCAR (Vtab_bar_button_margin))
3244 && FIXNUMP (XCDR (Vtab_bar_button_margin)))
3245 {
3246 extra_x = XFIXNUM (XCAR (Vtab_bar_button_margin));
3247 extra_y = XFIXNUM (XCDR (Vtab_bar_button_margin));
3248 }
3249 else if (FIXNUMP (Vtab_bar_button_margin))
3250 extra_x = extra_y = XFIXNUM (Vtab_bar_button_margin);
3251 }
3252
3238 if (s->face->id == TOOL_BAR_FACE_ID) 3253 if (s->face->id == TOOL_BAR_FACE_ID)
3239 { 3254 {
3240 if (CONSP (Vtool_bar_button_margin) 3255 if (CONSP (Vtool_bar_button_margin)
@@ -8396,10 +8411,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8396 /* If mouse-highlight is an integer, input clears out 8411 /* If mouse-highlight is an integer, input clears out
8397 mouse highlighting. */ 8412 mouse highlighting. */
8398 if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight) 8413 if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight)
8399#if ! defined (USE_GTK)
8400 && (f == 0 8414 && (f == 0
8401 || !EQ (f->tool_bar_window, hlinfo->mouse_face_window)) 8415#if ! defined (USE_GTK)
8416 || !EQ (f->tool_bar_window, hlinfo->mouse_face_window)
8402#endif 8417#endif
8418 || !EQ (f->tab_bar_window, hlinfo->mouse_face_window))
8403 ) 8419 )
8404 { 8420 {
8405 clear_mouse_face (hlinfo); 8421 clear_mouse_face (hlinfo);
@@ -8823,7 +8839,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8823 { 8839 {
8824 static Lisp_Object last_mouse_window; 8840 static Lisp_Object last_mouse_window;
8825 Lisp_Object window = window_from_coordinates 8841 Lisp_Object window = window_from_coordinates
8826 (f, event->xmotion.x, event->xmotion.y, 0, false); 8842 (f, event->xmotion.x, event->xmotion.y, 0, false, false);
8827 8843
8828 /* A window will be autoselected only when it is not 8844 /* A window will be autoselected only when it is not
8829 selected now and the last mouse movement event was 8845 selected now and the last mouse movement event was
@@ -9034,6 +9050,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9034 { 9050 {
9035 /* If we decide we want to generate an event to be seen 9051 /* If we decide we want to generate an event to be seen
9036 by the rest of Emacs, we put it here. */ 9052 by the rest of Emacs, we put it here. */
9053 bool tab_bar_p = false;
9037 bool tool_bar_p = false; 9054 bool tool_bar_p = false;
9038 9055
9039 memset (&compose_status, 0, sizeof (compose_status)); 9056 memset (&compose_status, 0, sizeof (compose_status));
@@ -9070,6 +9087,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9070#endif 9087#endif
9071 if (f) 9088 if (f)
9072 { 9089 {
9090 /* Is this in the tab-bar? */
9091 if (WINDOWP (f->tab_bar_window)
9092 && WINDOW_TOTAL_LINES (XWINDOW (f->tab_bar_window)))
9093 {
9094 Lisp_Object window;
9095 int x = event->xbutton.x;
9096 int y = event->xbutton.y;
9097
9098 window = window_from_coordinates (f, x, y, 0, true, true);
9099 tab_bar_p = EQ (window, f->tab_bar_window);
9100
9101 if (tab_bar_p && event->xbutton.button < 4)
9102 handle_tab_bar_click
9103 (f, x, y, event->xbutton.type == ButtonPress,
9104 x_x_to_emacs_modifiers (dpyinfo, event->xbutton.state));
9105 }
9106
9073#if ! defined (USE_GTK) 9107#if ! defined (USE_GTK)
9074 /* Is this in the tool-bar? */ 9108 /* Is this in the tool-bar? */
9075 if (WINDOWP (f->tool_bar_window) 9109 if (WINDOWP (f->tool_bar_window)
@@ -9079,7 +9113,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9079 int x = event->xbutton.x; 9113 int x = event->xbutton.x;
9080 int y = event->xbutton.y; 9114 int y = event->xbutton.y;
9081 9115
9082 window = window_from_coordinates (f, x, y, 0, true); 9116 window = window_from_coordinates (f, x, y, 0, true, true);
9083 tool_bar_p = EQ (window, f->tool_bar_window); 9117 tool_bar_p = EQ (window, f->tool_bar_window);
9084 9118
9085 if (tool_bar_p && event->xbutton.button < 4) 9119 if (tool_bar_p && event->xbutton.button < 4)
@@ -9089,7 +9123,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9089 } 9123 }
9090#endif /* !USE_GTK */ 9124#endif /* !USE_GTK */
9091 9125
9092 if (!tool_bar_p) 9126 if (!tab_bar_p && !tool_bar_p)
9093#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 9127#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
9094 if (! popup_activated ()) 9128 if (! popup_activated ())
9095#endif 9129#endif
@@ -9136,6 +9170,8 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9136 { 9170 {
9137 dpyinfo->grabbed |= (1 << event->xbutton.button); 9171 dpyinfo->grabbed |= (1 << event->xbutton.button);
9138 dpyinfo->last_mouse_frame = f; 9172 dpyinfo->last_mouse_frame = f;
9173 if (f && !tab_bar_p)
9174 f->last_tab_bar_item = -1;
9139#if ! defined (USE_GTK) 9175#if ! defined (USE_GTK)
9140 if (f && !tool_bar_p) 9176 if (f && !tool_bar_p)
9141 f->last_tool_bar_item = -1; 9177 f->last_tool_bar_item = -1;
@@ -10142,6 +10178,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
10142 int unit, font_ascent, font_descent; 10178 int unit, font_ascent, font_descent;
10143#ifndef USE_X_TOOLKIT 10179#ifndef USE_X_TOOLKIT
10144 int old_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f); 10180 int old_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f);
10181 int old_tab_bar_height = FRAME_TAB_BAR_HEIGHT (f);
10145 Lisp_Object fullscreen; 10182 Lisp_Object fullscreen;
10146#endif 10183#endif
10147 10184
@@ -10161,6 +10198,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
10161 10198
10162#ifndef USE_X_TOOLKIT 10199#ifndef USE_X_TOOLKIT
10163 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); 10200 FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
10201 FRAME_TAB_BAR_HEIGHT (f) = FRAME_TAB_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
10164#endif 10202#endif
10165 10203
10166 /* Compute character columns occupied by scrollbar. 10204 /* Compute character columns occupied by scrollbar.
@@ -10185,18 +10223,20 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
10185 FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, 10223 FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
10186 false, Qfont); 10224 false, Qfont);
10187#ifndef USE_X_TOOLKIT 10225#ifndef USE_X_TOOLKIT
10188 if (FRAME_MENU_BAR_HEIGHT (f) != old_menu_bar_height 10226 if ((FRAME_MENU_BAR_HEIGHT (f) != old_menu_bar_height
10227 || FRAME_TAB_BAR_HEIGHT (f) != old_tab_bar_height)
10189 && !f->after_make_frame 10228 && !f->after_make_frame
10190 && (EQ (frame_inhibit_implied_resize, Qt) 10229 && (EQ (frame_inhibit_implied_resize, Qt)
10191 || (CONSP (frame_inhibit_implied_resize) 10230 || (CONSP (frame_inhibit_implied_resize)
10192 && NILP (Fmemq (Qfont, frame_inhibit_implied_resize)))) 10231 && NILP (Fmemq (Qfont, frame_inhibit_implied_resize))))
10193 && (NILP (fullscreen = get_frame_param (f, Qfullscreen)) 10232 && (NILP (fullscreen = get_frame_param (f, Qfullscreen))
10194 || EQ (fullscreen, Qfullwidth))) 10233 || EQ (fullscreen, Qfullwidth)))
10195 /* If the menu bar height changes, try to keep text height 10234 /* If the menu/tab bar height changes, try to keep text height
10196 constant. */ 10235 constant. */
10197 adjust_frame_size 10236 adjust_frame_size
10198 (f, -1, FRAME_TEXT_HEIGHT (f) + FRAME_MENU_BAR_HEIGHT (f) 10237 (f, -1, FRAME_TEXT_HEIGHT (f) + FRAME_MENU_BAR_HEIGHT (f)
10199 - old_menu_bar_height, 1, false, Qfont); 10238 + FRAME_TAB_BAR_HEIGHT (f)
10239 - old_menu_bar_height - old_tab_bar_height, 1, false, Qfont);
10200#endif /* USE_X_TOOLKIT */ 10240#endif /* USE_X_TOOLKIT */
10201 } 10241 }
10202 } 10242 }
@@ -13466,6 +13506,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
13466#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 13506#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
13467 terminal->popup_dialog_hook = xw_popup_dialog; 13507 terminal->popup_dialog_hook = xw_popup_dialog;
13468#endif 13508#endif
13509 terminal->change_tab_bar_height_hook = x_change_tab_bar_height;
13469#ifndef HAVE_EXT_TOOL_BAR 13510#ifndef HAVE_EXT_TOOL_BAR
13470 terminal->change_tool_bar_height_hook = x_change_tool_bar_height; 13511 terminal->change_tool_bar_height_hook = x_change_tool_bar_height;
13471#endif 13512#endif