Commit 89ef791c authored by Juri Linkov's avatar Juri Linkov

Small fixes for tty and w32.

* lisp/menu-bar.el (showhide-tab-bar): Visible on tty too.
* lisp/tab-bar.el (tab-bar-mode): Add binding [(control shift tab)] for w32.
* lisp/tab-line.el (tab-line-add-tab): Use tmm-prompt for buffer-menu on tty.
* src/w32term.c (w32_read_socket): Fix tool-bar clicks.
parent a7289c04
Pipeline #3084 passed with stage
in 66 minutes and 40 seconds
...@@ -1245,7 +1245,6 @@ mail status in mode line")) ...@@ -1245,7 +1245,6 @@ mail status in mode line"))
(bindings--define-key menu [showhide-tab-bar] (bindings--define-key menu [showhide-tab-bar]
'(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame '(menu-item "Tab Bar" toggle-tab-bar-mode-from-frame
:help "Turn tab bar on/off" :help "Turn tab bar on/off"
:visible (display-graphic-p)
:button :button
(:toggle . (menu-bar-positive-p (:toggle . (menu-bar-positive-p
(frame-parameter (menu-bar-frame-for-menubar) (frame-parameter (menu-bar-frame-for-menubar)
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
default-frame-alist))))) default-frame-alist)))))
(when tab-bar-mode (when tab-bar-mode
(global-set-key [(control shift iso-lefttab)] 'tab-bar-switch-to-prev-tab) (global-set-key [(control shift iso-lefttab)] 'tab-bar-switch-to-prev-tab)
(global-set-key [(control shift tab)] 'tab-bar-switch-to-prev-tab)
(global-set-key [(control tab)] 'tab-bar-switch-to-next-tab))) (global-set-key [(control tab)] 'tab-bar-switch-to-next-tab)))
(defun tab-bar-mouse (event) (defun tab-bar-mouse (event)
...@@ -334,7 +335,7 @@ If `rightmost', create as the last tab." ...@@ -334,7 +335,7 @@ If `rightmost', create as the last tab."
(setcdr prev-tab (cons new-tab (cdr prev-tab)))))))) (setcdr prev-tab (cons new-tab (cdr prev-tab))))))))
(set-frame-parameter nil 'tabs tabs) (set-frame-parameter nil 'tabs tabs)
(tab-bar-select-tab new-tab) (tab-bar-select-tab new-tab)
(unless (and (display-graphic-p) tab-bar-mode) (unless tab-bar-mode
(message "Added new tab with the current window configuration")))) (message "Added new tab with the current window configuration"))))
...@@ -395,14 +396,14 @@ specified by `tab-bar-close-tab-select'." ...@@ -395,14 +396,14 @@ specified by `tab-bar-close-tab-select'."
"Create a new named window configuration without having to click a tab." "Create a new named window configuration without having to click a tab."
(interactive) (interactive)
(tab-bar-add-tab) (tab-bar-add-tab)
(unless (and (display-graphic-p) tab-bar-mode) (unless tab-bar-mode
(message "Added new tab with the current window configuration"))) (message "Added new tab with the current window configuration")))
(defun delete-tab () (defun delete-tab ()
"Delete the current window configuration without clicking a close button." "Delete the current window configuration without clicking a close button."
(interactive) (interactive)
(tab-bar-close-current-tab) (tab-bar-close-current-tab)
(unless (and (display-graphic-p) tab-bar-mode) (unless tab-bar-mode
(message "Deleted the current tab"))) (message "Deleted the current tab")))
(defalias 'list-tabs 'tab-bar-list) (defalias 'list-tabs 'tab-bar-list)
......
...@@ -203,8 +203,10 @@ Reduce tab width proportionally to space taken by other tabs." ...@@ -203,8 +203,10 @@ Reduce tab width proportionally to space taken by other tabs."
(defun tab-line-add-tab (&optional e) (defun tab-line-add-tab (&optional e)
(interactive "e") (interactive "e")
;; Maybe (buffer-menu-open) (if window-system
(mouse-buffer-menu e)) (mouse-buffer-menu e) ; like (buffer-menu-open)
;; tty menu doesn't support mouse clicks, so use tmm
(tmm-prompt (mouse-buffer-menu-keymap))))
(defun tab-line-select-tab (&optional e) (defun tab-line-select-tab (&optional e)
"Switch to the selected tab. "Switch to the selected tab.
......
...@@ -5097,7 +5097,7 @@ w32_read_socket (struct terminal *terminal, ...@@ -5097,7 +5097,7 @@ w32_read_socket (struct terminal *terminal,
int x = XFIXNAT (inev.x); int x = XFIXNAT (inev.x);
int y = XFIXNAT (inev.y); int y = XFIXNAT (inev.y);
window = window_from_coordinates (f, x, y, 0, 1, 0); window = window_from_coordinates (f, x, y, 0, 1, 1);
if (EQ (window, f->tab_bar_window)) if (EQ (window, f->tab_bar_window))
{ {
...@@ -5122,7 +5122,7 @@ w32_read_socket (struct terminal *terminal, ...@@ -5122,7 +5122,7 @@ w32_read_socket (struct terminal *terminal,
int x = XFIXNAT (inev.x); int x = XFIXNAT (inev.x);
int y = XFIXNAT (inev.y); int y = XFIXNAT (inev.y);
window = window_from_coordinates (f, x, y, 0, 1, 0); window = window_from_coordinates (f, x, y, 0, 1, 1);
if (EQ (window, f->tool_bar_window)) if (EQ (window, f->tool_bar_window))
{ {
......
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