x11/xidle: fix double triggering on screen unlock

A problem reported that xidle triggers twice: the first one when it
reaches idle timeout and locks the screen (which is expected), and the
second time immediately when the screen is unlocked (which is
undesired).
The problem is that, apparently, the XScreenServer extension, which
xidle uses, sends ScreenSaverOn on locking and ScreenSaverOff on
unlocking. Currently, xidle doesn't filter events by locking state, so
it locks the screen again when the ScreenSaverOff event comes in.

The fix is to run a screensaver only on the ScreenSaverOn event.

PR:	275761
This commit is contained in:
Roman Bogorodskiy 2023-12-24 10:46:21 +01:00
parent 5c82fb6dee
commit 08ff7700f2
2 changed files with 12 additions and 0 deletions

View file

@ -1,5 +1,6 @@
PORTNAME= xidle
PORTVERSION= 26052015
PORTREVISION= 1
CATEGORIES= x11
MASTER_SITES= LOCAL/novel

View file

@ -0,0 +1,11 @@
--- xidle.c.orig 2023-12-17 16:06:14 UTC
+++ xidle.c
@@ -426,7 +426,7 @@ main(int argc, char **argv)
* Was for real or due to terminal
* switching or a locking program?
*/
- if (timeout > 0 && se->forced == False)
+ if (timeout > 0 && se->forced == False && se->state == ScreenSaverOn)
action(&x, args);
}
break;