Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempts to select 'nil' window #28

Closed
Stebalien opened this issue Mar 14, 2024 · 1 comment · Fixed by #32
Closed

Attempts to select 'nil' window #28

Stebalien opened this issue Mar 14, 2024 · 1 comment · Fixed by #32
Labels
bug Something isn't working

Comments

@Stebalien
Copy link
Contributor

I think I've finally tracked down the source of the (wrong-type-argument window-live-p nil) error I've been seeing (finally got a backtrace):

exwm/exwm.el

Line 512 in 1821027

(select-window window)))))

The cause seems pretty clear: the buffer here may not actually have a current window:

exwm/exwm.el

Lines 499 to 512 in 1821027

(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)))))

get-buffer-window is probably returning nil.

@Stebalien Stebalien added the bug Something isn't working label Mar 14, 2024
@rayslava
Copy link

rayslava commented Apr 1, 2024

It seems this is the error that I get from time to time after launching Gnus.
Some windows can't get focus with this error, and switching workspaces leads to random switching to previously active windows from time to time.

Is there any fix or at least workaround for this one?

Stebalien added a commit that referenced this issue Apr 1, 2024
* 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
fixes #29
fixes #30
Stebalien added a commit that referenced this issue Apr 3, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants