Ignoring first click event on dpms or screen wakeup

screensaverxorgxsetyocto

I'm trying to make a screensaver feature (or screen blanking) from user request that allows the screen to go blank and wakeup via user touch input. The problem I'm having is trying to handle the first "click" event on wakeup, as this is an embedded panel pc device that only has a touch screen and users simply don't know where they are tapping when the screen is off (which means that users can cancel and tap things they don't intend to).

I see there is an existing question Xorg – ignore first click event when resuming from Screen Blanking that was asked about 3 years ago that I'm wondering if there are any updates to. I've played around with xset enabling dpms, setting various timeouts, screen blanking, but everything ends up in the first touch event immediately triggering the button below where the user clicks.

I'm using Poky 1.8 (Fido), Kernel 3.19.5 and have complete access to source code if anyone knows any way to handle these events in C++. The program does not have a lock screen, and is running as root. I'm working on building XScreensaver just to see if this would help, or if this is just a lost cause.

Best Answer

I had the same problem (also using yocto fido). I couldn't use the proposed answer because i didn't manage to build xscreensaver (has way to many dependencies)

I finally solved it by using xssstart and modifying slock which is a screen locker. I called it clicklock

https://github.com/zpfvo/clicklock

I also made a fork of xssstart with autotools build files for easy cross-compilation (just use inherit autotools in the recipe): https://github.com/zpfvo/xssstart

xssstart runs a command as soon as the screensaver gets enabled and clicklock is just a black fullscreen window which closes after the first touch or key event.

So you have to run xssstart clicklock

Related Question