Fix emacs ephemeral window in stumpwm
This commit is contained in:
parent
e6ff121cc7
commit
20bcc0d97f
1 changed files with 9 additions and 1 deletions
|
|
@ -494,7 +494,15 @@ If PERSISTENT is t, smart-kill will hide the window instead of killing it."
|
||||||
(let* ((screen (current-screen))
|
(let* ((screen (current-screen))
|
||||||
(current (current-group))
|
(current (current-group))
|
||||||
(target (find-group screen group-name))
|
(target (find-group screen group-name))
|
||||||
(existing (or (when window-class
|
;; Once a scratchpad window has been created, it stays resident in
|
||||||
|
;; its own dedicated group even after we switch away from it. So the
|
||||||
|
;; most reliable "does it already exist" check is simply: does the
|
||||||
|
;; target group already have a window in it? This avoids relying on
|
||||||
|
;; window title, which for programs like Emacs changes constantly
|
||||||
|
;; based on the current buffer and would otherwise cause a fresh
|
||||||
|
;; instance to be spawned every time.
|
||||||
|
(existing (or (first (group-windows target))
|
||||||
|
(when window-class
|
||||||
(find-if (lambda (w) (string= (window-class w) window-class))
|
(find-if (lambda (w) (string= (window-class w) window-class))
|
||||||
(screen-windows screen)))
|
(screen-windows screen)))
|
||||||
(when window-title
|
(when window-title
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue