mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
core: unlock on sigusr1 (#82)
* Add SIGUSR1 to unlock * minor style improvements --------- Co-authored-by: Vaxry <vaxry@vaxry.net>
This commit is contained in:
parent
844a899254
commit
146965e7fb
1 changed files with 9 additions and 0 deletions
|
@ -286,6 +286,13 @@ void CHyprlock::onGlobalRemoved(void* data, struct wl_registry* registry, uint32
|
|||
|
||||
// end wl_registry
|
||||
|
||||
static void handleUnlockSignal(int sig) {
|
||||
if (sig == SIGUSR1) {
|
||||
Debug::log(LOG, "Unlocking with a SIGUSR1");
|
||||
g_pHyprlock->unlockSession();
|
||||
}
|
||||
}
|
||||
|
||||
void CHyprlock::run() {
|
||||
m_sWaylandState.registry = wl_display_get_registry(m_sWaylandState.display);
|
||||
|
||||
|
@ -305,6 +312,8 @@ void CHyprlock::run() {
|
|||
|
||||
lockSession();
|
||||
|
||||
signal(SIGUSR1, handleUnlockSignal);
|
||||
|
||||
pollfd pollfds[] = {
|
||||
{
|
||||
.fd = wl_display_get_fd(m_sWaylandState.display),
|
||||
|
|
Loading…
Reference in a new issue