Want a way to ensure stability of window dimensions after a fullscreen change
(This is copied from bug 765648 in Bugzilla)
Currently, when you call gtk_window_fullscreen/unfullscreen, you would get window_state_event signal to inform the state change if supported.
However, when window_state_event is arrived, it seems the dimensions of the window are not guaranteed to be stable yet, and there would be some following configure_event and size_allocate signals to update the dimensions.
This is an issue for us (Firefox) because page reflow is expensive, and thus we want to collapse the resize and fullscreen change into one reflow to make it faster.
We achieve this on Windows and Mac via synchronously resizing the window directly, since they don't really have a fullscreen mechanism. (Mac has one, but that doesn't fit our model very well, so we don't use it.)
The main issue on Linux with GTK+ is that:
- the dimensions may not be stable when window_state_event arrives,
- configure_event and size_allocate may not come at all for fullscreen change, so there is no place where the window dimensions are guaranteed to be stable, and the handling code is guaranteed to be called.
Would you mind providing some suggestion on this situation? Or probably I'm missing something so it is actually fixable?
You may want to see https://bugzilla.mozilla.org/show_bug.cgi?id=1254448 for some more discussions.