diff --git a/src/ext/popup-message.lisp b/src/ext/popup-message.lisp index 38e29043c..d09bc1b5c 100644 --- a/src/ext/popup-message.lisp +++ b/src/ext/popup-message.lisp @@ -33,6 +33,10 @@ :buffer buffer :width width :height height + ;; NOTE: Block mouse clicks on popup windows to prevent them from gaining focus. + ;; If a popup window gains focus, it becomes the only active window in the window-tree, + ;; which prevents Lem from being able to close it. + ;; Mouse scrolling remains enabled since popup windows are used for displaying text content. :clickable nil :style style))) (buffer-start (window-view-point window)) (window-see window) diff --git a/src/ext/popup-window.lisp b/src/ext/popup-window.lisp index 6789c055b..f910c9979 100644 --- a/src/ext/popup-window.lisp +++ b/src/ext/popup-window.lisp @@ -308,6 +308,7 @@ (buffer (alexandria:required-argument :buffer)) (width (alexandria:required-argument :width)) (height (alexandria:required-argument :height)) + (clickable t) style) (let* ((style (ensure-style style)) (border-size (if (style-use-border style) +border-size+ 0)) @@ -335,6 +336,7 @@ :border-shape (style-shape style) :background-color (style-background-color style) :cursor-invisible (style-cursor-invisible style) + :clickable clickable :style style)))) (defun update-popup-window (&key (source-window (alexandria:required-argument :source-window)) diff --git a/src/mouse.lisp b/src/mouse.lisp index 162722439..2af09a253 100644 --- a/src/mouse.lisp +++ b/src/mouse.lisp @@ -178,7 +178,8 @@ (focus-window-position (current-frame) (mouse-event-x mouse-event) (mouse-event-y mouse-event)) - (when window + (when (and window + (window-clickable window)) (handle-mouse-button-down (window-buffer window) mouse-event :window window diff --git a/src/window/window.lisp b/src/window/window.lisp index 45e5627ae..c5d500066 100644 --- a/src/window/window.lisp +++ b/src/window/window.lisp @@ -105,6 +105,10 @@ (deleted :initform nil :accessor window-deleted-p) + (clickable + :initarg :clickable + :initform t + :reader window-clickable) (parameters :initform nil :accessor window-parameters)))