While the fix worked in my tests, the compositor is allowed to ignore a requested window state change which could have entered an eternal loop. Avoid this by limiting the while loop to 2x round-trips.
2721b937fb