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

fix: don't restart if zero active screens are reported #3078

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

farhaven
Copy link

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

On laptops and similar devices, RandR sometimes returns zero active screens, for example when closing a laptop's lid before it suspends.

Don't restart in that case because the new polybar instance will see zero screens and quit. Instead, just ignore those kind of events.

Related Issues & Documents

Fixes #2418.

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks good.

Please also add an entry to the changelog under a Changed header

src/components/screen.cpp Outdated Show resolved Hide resolved
src/components/screen.cpp Outdated Show resolved Hide resolved
On laptops and similar devices, RandR sometimes returns zero active
screens, for example when closing a laptop's lid before it suspends.

Don't restart in that case because the new polybar instance will see
zero screens and quit. Instead, just ignore those kind of events.
@farhaven
Copy link
Author

farhaven commented Feb 4, 2024

Ping :)

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.

Polybar crashes when the system wakes up from sleep
2 participants