Skip to content

clutter/stage: Update input devices right after doing a relayout

This is the first of three MRs required to remove the shell_global_sync_pointer workaround, the other MRs are !554 (closed) and !555 (closed).

The main change is 40d5a48e:

Instead of waiting one allocation cycle for triggering a repick of the pointer, update the input devices during the same update of the stage after the allocations of actors changed. This simply makes sense, we don't want to possibly wait minutes until the next relayout happens for doing a repick in response to changes of an actor that are already visible.

To get notified about whether the stage has to be repicked, add a new private method _clutter_stage_queue_repick to ClutterStage instead of repicking on every full stage relayout. This makes sure a repick also happens if an actors allocation changed without queuing a full stage relayout. In the future we probably also want to use this method to queue a repick after translations (ie. animations) that affected the actors position finished.

Also move the repick before the redraw while still finishing the queued redraws before the repick. The former allows covering the changes the repick did to any actors in the very same stage update cycle (otherwise we'd have to wait for the next frame when the repick resulted in a changed hover state of an actor), the latter is needed so the stage clip we check the device coordinates against is correct.


This also fixes updating the device actor for tablet tools and touch sequences, which both didn't get updated if the actor underneath the pointer changes.

This, together with emitting crossing events on modals, allows getting rid of shell_global_sync_pointer and its synthesized motion events.

Edited by Jonas Dreßler

Merge request reports