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

Check X connection and terminate when it is gone. #478

Closed
wants to merge 1 commit into from

Conversation

c0dev0id
Copy link
Contributor

@c0dev0id c0dev0id commented Oct 16, 2021

The X connection is never explicitly checked in the main loop. When the X connection is terminated, spectrwm keeps running.

Unfortunately the bar update logic does a call (https://github.com/conformal/spectrwm/blob/master/spectrwm.c#L2611) which leads to the termination of spectrwm. So while the bar is shown, killing X also leads spectrwm to terminate. If the bar is not shown, this call is not made and spectrwm kept running. This masked the issue.

Fixes: #474

In this PR I check the X connection explicitly in the main loop. However, xcb_flush(conn) is called various times and it returns <= 0 on failure. This could be used to detect connection issues as well.

@bket
Copy link
Contributor

bket commented Oct 24, 2021

Fix works for me.

bob-beck pushed a commit to openbsd/ports that referenced this pull request Dec 19, 2021
Fix proposed to upstream in PR conformal/spectrwm#478

ok bket@
@c0dev0id
Copy link
Contributor Author

c0dev0id commented Nov 2, 2022

ping after on year (almost) :-)

@c0dev0id
Copy link
Contributor Author

Looks like this has been fixed by 987b2ff

@c0dev0id c0dev0id closed this Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpectrWM keeps running when X is killed
2 participants