Skip to content

Drop parent->realized => child->realized invariant

Alexander Larsson requested to merge alexl/gtk:drop-realize-invariant into master

We already dropped this invariant in gtk_widget_verify_invariants() because it was not true in all cases. Also, it is not really useful these days as we extended what it means to be a "child" to also include widgets in different toplevels.

For example, a popup in a popup button need not be realized just because the button is in a realized window. The main invariants we want are:

  • Parent is realized before child
  • Widget is realized before it is mapped

This sounds like its not a huge deal, but in fact it is a massive win for things like menus, because when we go between menus in a menubar each switch between two open menus involves a lot of intermingled crossing events to different surfaces and for each of these the tooltip window of the toplevel gets assigned to the new surface. This shouldn't be a huge deal, as the tooltip window is not even visible, but due to the realized invariant it get re-realized each time it gets re-assigned.

Merge request reports