Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions window-tool-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ AVG-MEMORY-USE is a list of averages, with the same meaning as
"<tab-line> <mouse-2>" #'window-tool-bar--call-button
"<tab-line> <double-mouse-2>" #'window-tool-bar--call-button
"<tab-line> <triple-mouse-2>" #'window-tool-bar--call-button
"<mode-line> <mouse-1>" #'window-tool-bar--call-button
"<mode-line> <double-mouse-1>" #'window-tool-bar--call-button
"<mode-line> <triple-mouse-1>" #'window-tool-bar--call-button
"<mode-line> <mouse-2>" #'window-tool-bar--call-button
"<mode-line> <double-mouse-2>" #'window-tool-bar--call-button
"<mode-line> <triple-mouse-2>" #'window-tool-bar--call-button

;; Mouse down events do nothing. A binding is needed so isearch
;; does not exit when the tab bar is clicked.
Expand All @@ -202,7 +208,13 @@ AVG-MEMORY-USE is a list of averages, with the same meaning as
"<tab-line> <triple-down-mouse-1>" #'window-tool-bar--ignore
"<tab-line> <down-mouse-2>" #'window-tool-bar--ignore
"<tab-line> <double-down-mouse-2>" #'window-tool-bar--ignore
"<tab-line> <triple-down-mouse-2>" #'window-tool-bar--ignore)
"<tab-line> <triple-down-mouse-2>" #'window-tool-bar--ignore
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, looks like a gap in the logic.

"<mode-line> <down-mouse-1>" #'window-tool-bar--ignore
"<mode-line> <double-down-mouse-1>" #'window-tool-bar--ignore
"<mode-line> <triple-down-mouse-1>" #'window-tool-bar--ignore
"<mode-line> <down-mouse-2>" #'window-tool-bar--ignore
"<mode-line> <double-down-mouse-2>" #'window-tool-bar--ignore
"<mode-line> <triple-down-mouse-2>" #'window-tool-bar--ignore)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is needed? This is intended to be handled by just a few lines below:

(keymap-set window-tool-bar--button-keymap
            "<mode-line>"
            (keymap-lookup window-tool-bar--button-keymap "<tab-line>"))


;; Allow the window tool bar to be placed in header line or mode line
;; as well. These use different keymap prefixes.
Expand Down Expand Up @@ -354,7 +366,8 @@ MENU-ITEM is a menu item to convert. See info node `(elisp)Tool Bar'."
str))
(enabled
(add-text-properties 0 len
'(mouse-face window-tool-bar-button-hover
'(mouse-face
window-tool-bar-button-hover
keymap window-tool-bar--button-keymap
face window-tool-bar-button)
str))
Expand Down Expand Up @@ -426,7 +439,7 @@ enclosed in a `progn' form. ELSE-FORMS may be empty."
(defvar window-tool-bar--ignored-event-types
(let ((list (append
'(mouse-movement pinch
wheel-down wheel-up wheel-left wheel-right)
wheel-down wheel-up wheel-left wheel-right)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this line -- it's not proper indentation for Emacs data lists.

;; Prior to emacs 30, wheel events could also surface as
;; mouse-<NUM> buttons.
(window-tool-bar--static-if (version< emacs-version "30")
Expand Down Expand Up @@ -614,9 +627,9 @@ will always return the symbol text."
(let ((tool-bar-always-show-default nil))
(if (and (version< emacs-version "30")
(eq 'text (window-tool-bar--style)))
;; This code path is a less efficient workaround.
(window-tool-bar--make-keymap-1)
(keymap-global-lookup "<tool-bar>"))))
;; This code path is a less efficient workaround.
(window-tool-bar--make-keymap-1)
(keymap-global-lookup "<tool-bar>"))))

(declare-function image-mask-p "image.c" (spec &optional frame))

Expand Down