XWayland: Additional IDLE_NOTIFY events returned when switching from full-screen
I am noticing this issue when running Vulkan apps through RADV (presenting to an X surface via XWayland). I didn't yet try to reproduce it on non-Vulkan apps.
When I switch from a full-screen app to another app (for example via Alt+Tab), XWayland returns IDLE_NOTIFY events even for pixmaps that were already idle (an IDLE_NOTIFY message was already sent but the pixmap wasn't presented again).
I inserted some printf calls to log when a pixmap is presented and when an IDLE_NOTIFY event for it is returned. In this case, 3 pixmaps were used ("image 0-2"). Terminal output during such an application switch looks something like this:
[...]
presenting image 0
idle_notify received for image 2
presenting image 1
idle_notify received for image 0
presenting image 2
idle_notify received for image 1
presenting image 0
idle_notify received for image 0
presenting image 1
idle_notify received for image 2
idle_notify received for image 0
idle_notify received for image 1
In this case, image 0 receives two IDLE_NOTIFY events after just one present operation.
This issue only occurs in XWayland, not in a normal X session. I'm experiencing this on a Fedora 36 System using KDE Plasma as a DE (KWin as compositor).