Windows with client-side decorations flicker when resizing on macOS
Steps to reproduce
- Launch a gtk4 application which contains a window with client-side decoration (i.e.
GtkHeaderBar
).- I originally used the
search_bar
example from thegtk4-rs
repository. - I can also reproduce the problem with the
gtk4-demo
example program.
- I originally used the
- Resize the window continuously.
Current behavior
The window occasionally disappears / goes invisible. For a while, it will resize smoothly but then disappear intermittently, only to reappear when the cursor is moved a bit further. However, there are also stretches where the window will basically disappear and reappear every other pixel, giving it a "flickering" effect. It is also possible to release the cursor while the window is invisible. In that case, it can be brought back by switching to another application, causing the Gtk app to become inactive and thus triggering a redraw.
The effect is absent for windows which are not using client-side decoration. This can also be seen in the video towards the end.
Expected outcome
The window should stay visible during resizing at all times.
Version information
- Gtk4 4.4.1 installed via homebrew, i.e. with the bugfix !4008 (merged) applied as a patch to the official 4.4.1. I also observed the problem with 4.5.0.
- macOS Monterey 12.0.1 on arm64 (M1)
Additional information
- I recorded a screen cast of the effect and posted it on YouTube: https://youtu.be/y_HTxRzSemU
- I don't have an Intel Mac at hand, so I have no idea if this is M1 specific. I understand that MacOS issues in general and ones specific to Apple Silicon in particular are less accessible than those which also affect Linux. I'd be happy to help track this problem down, but I wouldn't know where to start on my own.