Commit 2ee0a21f authored by Renaud Casenave-Pere's avatar Renaud Casenave-Pere Committed by Philippe Brochard
Browse files

Do not steal the focus on focus-in

parent 35913a8b
......@@ -130,6 +130,14 @@
(manage-focus window root-x root-y)))
(define-handler main-mode :focus-in (window)
(unless (child-equal-p window (focused-window))
(set-focus-to-current-child)))
(define-handler main-mode :exposure (window)
(awhen (find-frame-window window)
(display-frame-info it)))
......
......@@ -570,15 +570,23 @@ they should be windows. So use this function to make a window out of them."
(setf (xlib:window-priority window) :above)))
(defun no-focus ()
"don't focus any window but still read keyboard events."
(xlib:set-input-focus *display* *no-focus-window* :pointer-root))
(let ((focused-window nil))
(defun no-focus ()
"don't focus any window but still read keyboard events."
(xlib:set-input-focus *display* *no-focus-window* :pointer-root)
(setf focused-window nil))
(defun focus-window (window)
"Give the window focus."
(no-focus)
(when (xlib:window-p window)
(xlib:set-input-focus *display* window :parent)
(setf focused-window window)))
(defun focused-window ()
focused-window))
(defun focus-window (window)
"Give the window focus."
(no-focus)
(when (xlib:window-p window)
(xlib:set-input-focus *display* window :parent)))
(defun raise-and-focus-window (window)
"Raise and focus."
......
Supports Markdown
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