FlafyDev / wayland_shell

MIT License
1 stars 1 forks source link

GlobalRect's onChange should only be called when the rect changes #5

Open darkwater opened 1 month ago

FlafyDev commented 1 month ago

The issue is that to do this we need to know the global offset of the current frame to compare with the previous global offset and decide whether to call onChange.

The global offset is set in the layout phase and I couldn't find any callback that fires after the layout phase without triggering the paint phase and using the paint callback. (paint is after layout)

darkwater commented 1 month ago

Wouldn't it be sufficient to just keep a Rect? last; on RenderGlobalRect and compare before calling onChange? The only thing I mean is that onChange shouldn't be called twice in a row with the same Rect.

FlafyDev commented 1 month ago

The only thing I mean is that onChange shouldn't be called twice in a row with the same Rect.

ohh then yeah we should do this