mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 06:48:00 +01:00
Correctly activate windows even if they're not in the iconic state (#32)
* exwm.el (exwm--on-ClientMessage): Handle the case where a window is hidden but not iconic. This code would previously error in some cases because a buffer wouldn't have an active window even when it was not in the iconic state, likely due to a focus race somewhere. fixes #28
This commit is contained in:
parent
bf921084b4
commit
236f3ca467
1 changed files with 7 additions and 10 deletions
17
exwm.el
17
exwm.el
|
@ -493,23 +493,20 @@ RAW-DATA contains unmarshalled ClientMessage event data."
|
|||
;; _NET_ACTIVE_WINDOW.
|
||||
((= type xcb:Atom:_NET_ACTIVE_WINDOW)
|
||||
(let ((buffer (exwm--id->buffer id))
|
||||
iconic window)
|
||||
window)
|
||||
(if (buffer-live-p buffer)
|
||||
;; Either an `exwm-mode' buffer (an X window) or a floating frame.
|
||||
(with-current-buffer buffer
|
||||
(when (eq exwm--frame exwm-workspace--current)
|
||||
(if exwm--floating-frame
|
||||
(select-frame exwm--floating-frame)
|
||||
(setq iconic (exwm-layout--iconic-state-p))
|
||||
(when iconic
|
||||
;; State change: iconic => normal.
|
||||
(set-window-buffer (frame-selected-window exwm--frame)
|
||||
(current-buffer)))
|
||||
;; Focus transfer.
|
||||
(setq window (get-buffer-window nil t))
|
||||
(when (or iconic
|
||||
(not (eq window (selected-window))))
|
||||
(select-window window)))))
|
||||
(unless window
|
||||
;; State change: iconic => normal.
|
||||
(setq window (frame-selected-window exwm--frame))
|
||||
(set-window-buffer window (current-buffer)))
|
||||
;; Focus transfer.
|
||||
(select-window window))))
|
||||
;; A workspace.
|
||||
(dolist (f exwm-workspace--list)
|
||||
(when (eq id (frame-parameter f 'exwm-outer-id))
|
||||
|
|
Loading…
Reference in a new issue