[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/tabs e3e0920: Try to fix macOS and Windows issues.
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] feature/tabs e3e0920: Try to fix macOS and Windows issues. |
Date: |
Mon, 16 Sep 2019 16:46:56 -0400 (EDT) |
branch: feature/tabs
commit e3e0920b9f30fd996fb880dc97268e821ab72e82
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
Try to fix macOS and Windows issues.
---
lisp/tab-bar.el | 4 ++--
src/nsfns.m | 29 ++---------------------------
src/nsterm.m | 19 +++++--------------
src/xdisp.c | 7 ++++++-
4 files changed, 15 insertions(+), 44 deletions(-)
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index c15eb29..7afb39a 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -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.")
diff --git a/src/nsfns.m b/src/nsfns.m
index 890da99..308586e 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -632,32 +632,7 @@ ns_set_tab_bar_lines (struct frame *f, Lisp_Object value,
Lisp_Object oldval)
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 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
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,
diff --git a/src/nsterm.m b/src/nsterm.m
index d95f7b9..ff2d195 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1089,7 +1089,7 @@ ns_update_begin (struct frame *f)
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 @@ not_in_argv (NSString *arg)
/* 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 @@ not_in_argv (NSString *arg)
willUseFullScreenPresentationOptions:
(NSApplicationPresentationOptions)proposedOptions
{
- return
proposedOptions|NSApplicationPresentationAutoHideTabbar|NSApplicationPresentationAutoHideToolbar;
+ return proposedOptions|NSApplicationPresentationAutoHideToolbar;
}
#endif
@@ -7788,7 +7787,7 @@ not_in_argv (NSString *arg)
}
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 @@ not_in_argv (NSString *arg)
#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))
{
diff --git a/src/xdisp.c b/src/xdisp.c
index f438688..197493b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] feature/tabs e3e0920: Try to fix macOS and Windows issues.,
Juri Linkov <=