Hi,
I don’t think that developing explanations about what I do helps to understand. It will just lead to debates about the appropriateness of my choices, polluting the discussion.
Only someone who knows the mechanisms of inhibitors well can understand, and try to help me, if a solution exists.
Someone who doesn’t know will systematically try to deviate to a subject that he knows, and therefore will not help me.
The problem posed is excessively simple to understand:
Plasma has an inhibition system for sleep mode (among others, but that’s only what interests me here). We place locks that prevent sleep mode. And when we remove the last lock, sleep mode is then possible. We are only talking about automatic sleep mode here. Manual sleep mode (for example by loginctl suspend) is not blocked by these locks.
During the period of inactivity, the display can very well go to sleep, which is logical.
It turns out that here, in the case that concerns me, removing the last lock blocking sleep has 2 actions that bother me:
- resetting the inactivity duration
- waking up the display, therefore the screens.
I have proof that it is indeed the removal of the lock (inhibitor) that is the cause, and that it is only when removing the last lock in place (because of course, we can set several locks in parallel).
Here are the events noted by xev when the lock was lifted:
VisibilityNotify event, serial 40, synthetic NO, window 0x5600001,
state VisibilityFullyObscured
VisibilityNotify event, serial 40, synthetic NO, window 0x5600001,
state VisibilityUnobscured
Expose event, serial 40, synthetic NO, window 0x5600001,
(0,0), width 178, height 10, count 3
Expose event, serial 40, synthetic NO, window 0x5600001,
(0.10), width 10, height 58, count 2
Expose event, serial 40, synthetic NO, window 0x5600001,
(68,10), width 110, height 58, count 1
Expose event, serial 40, synthetic NO, window 0x5600001,
(0,68), width 178, height 110, count 0
So my question is to know what plasma mechanism causes this operation, and if I could block these events, before removing my last lock, to possibly release them after.
And I think that only a developer of this mechanism will understand what it is.
Thank you for your attention.