From bdd32a8a6deaaaf7fa9c56fca6ba664d5def0dd0 Mon Sep 17 00:00:00 2001 From: bluepython508 <16466646+bluepython508@users.noreply.github.com> Date: Thu, 12 Feb 2026 16:31:39 +0000 Subject: [PATCH] Handle focus changes correctly on lock - refocus the "focused" window --- main.janet | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main.janet b/main.janet index 26d1cf8..17b8a78 100644 --- a/main.janet +++ b/main.janet @@ -211,12 +211,11 @@ (defn seat/focus [seat window] (defn focus-window [window] - (unless (= (seat :focused) window) - (:focus-window (seat :obj) (window :obj)) - (put seat :focused window) - (set (wm :render-order) (filter |(not (= $ window)) (wm :render-order))) - (array/push (wm :render-order) window) - (:place-top (window :node)))) + (:focus-window (seat :obj) (window :obj)) + (put seat :focused window) + (set (wm :render-order) (filter |(not (= $ window)) (wm :render-order))) + (array/push (wm :render-order) window) + (:place-top (window :node))) (defn clear-focus [] (when (seat :focused) (:clear-focus (seat :obj)) @@ -287,6 +286,9 @@ (if (or (not (seat :focused-output)) ((seat :focused-output) :removed)) (seat/focus-output seat (first (wm :outputs)))) + (when (not= (seat :layer-focus) :non-exclusive) + (seat/focus seat (seat :focused))) + (seat/focus seat nil) (if-let [window (seat :window-interaction)]