application get first touch event while the screen is locked
When using the screensaver on wayland, the screen fades out but all applications are still there and can get the first click/touch on the display. After the first click, the "Ulock your Desktop" gui is rendered, and from this moment all events are intercepted by the unlock window.
I just commented the line which turns off the backlight on weston_compositor_sleep() and found out all layers are still there also when the screen is locked.
This is a picture describing the issue. The upper image is made when the screen is locked, then touching on the text input field, the Unlock image is displayed (middle image) and after touching on the green ball, the screen unlocks, and we can see the input field is selected and the keyboard is up.
The same issue can be verified also with the screen locked, if we touch on the terminal icon (top left corner), when the screen is unlocked, we can see the terminal is opened.
Debugging the screen locking mechanism (function lock() on shell.c file), panel_layer, fullscreen_layer, input_panel_layer and layer are hidden, the lock_layer is set, and then the weston_compositor_sleep() is called, which puts the compositor on the sleep status.
From what I sow, none of the previous functions takes effect until the next repaint, which doesn't occur because now the compositor->state = WESTON_COMPOSITOR_SLEEPING is set.
I found a solution to this problem by patching weston_output_maybe_repaint() to consider also this case (compositor on sleep status but repaint_needed). With this patch, everything on screen is hidden, and I have no unwanted clicks/touches propagated into the applications after screen unlock.
I don't know if this is the correct solution, but I'm going to create a pull request and maybe we can discuss about it.