Commit e3e0920b authored by Juri Linkov's avatar Juri Linkov

Try to fix macOS and Windows issues.

parent 6474abc3
Pipeline #3161 failed with stage
in 90 minutes and 1 second
......@@ -122,7 +122,7 @@ on a console which has no window system but does have a mouse."
(when (eq (car-safe binding) 'menu-item)
(when (> (+ column (length (nth 1 binding))) x-position)
;; TODO: handle close
(unless (get-text-property (- x-position column) 'close (nth 1 binding))
(unless (get-text-property (- x-position column) 'close-tab (nth 1 binding))
(call-interactively (nth 2 binding)))
(throw 'done t))
(setq column (+ column (length (nth 1 binding))))))
......@@ -180,7 +180,7 @@ Its main job is to show tabs in the tab bar."
data-directory)
:margin (2 . 0)
:ascent center)
'close t
'close-tab t
:help "Click to close tab")
"Button for closing the clicked tab.")
......
......@@ -632,32 +632,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
nlines = 0;
if (nlines)
{
FRAME_EXTERNAL_TAB_BAR (f) = 1;
update_frame_tab_bar (f);
}
else
{
if (FRAME_EXTERNAL_TAB_BAR (f))
{
free_frame_tab_bar (f);
FRAME_EXTERNAL_TAB_BAR (f) = 0;
{
EmacsView *view = FRAME_NS_VIEW (f);
int fs_state = [view fullscreenState];
if (fs_state == FULLSCREEN_MAXIMIZED)
{
[view setFSValue:FULLSCREEN_WIDTH];
}
else if (fs_state == FULLSCREEN_HEIGHT)
{
[view setFSValue:FULLSCREEN_NONE];
}
}
}
}
update_frame_tab_bar (f);
{
int inhibit
......@@ -1371,7 +1346,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
RES_TYPE_STRING);
parms = get_geometry_from_preferences (dpyinfo, parms);
window_prompting = gui_figure_window_size (f, parms, true,
window_prompting = gui_figure_window_size (f, parms, true, true,
&x_width, &x_height);
tem = gui_display_get_arg (dpyinfo, parms, Qunsplittable, 0, 0,
......
......@@ -1089,7 +1089,7 @@ static NSRect constrain_frame_rect(NSRect frameRect, bool isFullscreen)
if ([view isFullscreen] && [view fsIsNative])
{
// Fix reappearing tool bar or tab bar in fullscreen for Mac OS X 10.7
BOOL tarbar_visible = FRAME_EXTERNAL_TAB_BAR (f) ? YES : NO;
BOOL tarbar_visible = NO;
NSToolbar *tabbar = [FRAME_NS_VIEW (f) tabbar];
if (! tarbar_visible != ! [tabbar isVisible])
[tabbar setVisible: tarbar_visible];
......@@ -7328,8 +7328,7 @@ - (void)createTabbar: (struct frame *)f
/* Don't set frame garbaged until tab bar is up to date?
This avoids an extra clear and redraw (flicker) at frame creation. */
if (FRAME_EXTERNAL_TAB_BAR (f)) wait_for_tab_bar = YES;
else wait_for_tab_bar = NO;
wait_for_tab_bar = NO;
#ifdef NS_IMPL_COCOA
......@@ -7756,7 +7755,7 @@ - (NSApplicationPresentationOptions)window:(NSWindow *)window
willUseFullScreenPresentationOptions:
(NSApplicationPresentationOptions)proposedOptions
{
return proposedOptions|NSApplicationPresentationAutoHideTabbar|NSApplicationPresentationAutoHideToolbar;
return proposedOptions|NSApplicationPresentationAutoHideToolbar;
}
#endif
......@@ -7788,7 +7787,7 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */
}
else
{
BOOL tarbar_visible = FRAME_EXTERNAL_TAB_BAR (emacsframe) ? YES : NO;
BOOL tarbar_visible = NO;
BOOL toolbar_visible = FRAME_EXTERNAL_TOOL_BAR (emacsframe) ? YES : NO;
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 \
&& MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
......@@ -7850,15 +7849,7 @@ - (void)windowDidExitFullScreen /* provided for direct calls */
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
[self updateCollectionBehavior];
#endif
if (FRAME_EXTERNAL_TAB_BAR (emacsframe))
{
[tabbar setVisible:YES];
update_frame_tab_bar (emacsframe);
[self updateFrameSize:YES];
[[self window] display];
}
else
[tabbar setVisible:NO];
[tabbar setVisible:NO];
if (FRAME_EXTERNAL_TOOL_BAR (emacsframe))
{
......
......@@ -13178,7 +13178,7 @@ tab_bar_item_info (struct frame *f, struct glyph *glyph, int *prop_idx, bool *cl
*prop_idx = XFIXNUM (prop);
*close_p = !NILP (Fget_text_property (make_fixnum (charpos),
Qclose,
Qclose_tab,
f->current_tab_bar_string));
return true;
......@@ -13348,6 +13348,7 @@ note_tab_bar_highlight (struct frame *f, int x, int y)
clear_mouse_face (hlinfo);
#ifndef HAVE_NS
/* Mouse is down, but on different tab-bar item? */
mouse_down_p = (gui_mouse_grabbed (dpyinfo)
&& f == dpyinfo->last_mouse_frame);
......@@ -13356,6 +13357,9 @@ note_tab_bar_highlight (struct frame *f, int x, int y)
return;
draw = mouse_down_p ? DRAW_IMAGE_SUNKEN : DRAW_IMAGE_RAISED;
#else
draw = DRAW_IMAGE_RAISED;
#endif /* HAVE_NS */
/* If tab-bar item is not enabled, don't highlight it. */
enabled_p = AREF (f->tab_bar_items, prop_idx + TAB_BAR_ITEM_ENABLED_P);
......@@ -34343,6 +34347,7 @@ window, nil if it's okay to leave the cursor partially-visible. */);
Vmake_cursor_line_fully_visible = Qt;
DEFSYM (Qmake_cursor_line_fully_visible, "make-cursor-line-fully-visible");
DEFSYM (Qclose_tab, "close-tab");
DEFVAR_LISP ("tab-bar-border", Vtab_bar_border,
doc: /* Border below tab-bar in pixels.
If an integer, use it as the height of the border.
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