-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
core: improve signal handling #539
base: main
Are you sure you want to change the base?
Conversation
@@ -1156,7 +1226,7 @@ zwlr_screencopy_manager_v1* CHyprlock::getScreencopy() { | |||
} | |||
|
|||
void CHyprlock::attemptRestoreOnDeath() { | |||
if (m_bTerminate || m_sCurrentDesktop != "Hyprland") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any Idea why we didn't try to restore when m_bTerminate
is true before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want to check if we are actually locked instead?
Cause if we aren't there is no point in trying to restore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhhh cuz if it crashes after nlock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah but terminate does not mean we already unlocked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh then ok idk
|
Use signalfd to handle SIGUSR1, SIGUSR2 via poll in the event loop.
1788316
to
1803834
Compare
This PR tries to handle SIGUSR1 and SIGUSR2 via the main thread using
signalfd
.I did that cause when we
forceUpdateTimers
, we are currently not safe in multiple ways.We don't acquire the timers lock for
m_vTimers
, which we can't do cause we are in a async signal context.We call other async signal unsafe functions.
So I tried moving
forceUpdateTimers
to the main thread (#536), but that has the problem that we need to wake the main thread somehow and that would require async signal unsafe functions again.Considering hyprlock is event driven using signalfd made sense.
I hope that this fixes#535. Seems like it does not, but this still makes sense to change i think.Some testing wanted before merging.
Thanks!