]> Pileus Git - ~andy/gtk/commit
Fixed GtkWindow/GtkWidget to properly emit hierarchy changed for embedded toplevels
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 26 Dec 2010 10:08:33 +0000 (19:08 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 6 Jan 2011 05:39:40 +0000 (14:39 +0900)
commit93c8058582aa8e6823bcf83b654da29f816a1547
tree33d00f05fe8d2336e6acf34875abdb0cf8c83ddb
parentaa787c9dd17c9dbee97c76209e62284cd836fdea
Fixed GtkWindow/GtkWidget to properly emit hierarchy changed for embedded toplevels

Now GtkWindow takes some measures when setting toplevelness:

  - When a window becomes toplevel after being embedded it saves
    the visibility state and reshow's itself so that the window
    re-realizes and presents itself again automatically

  - When emitting hierarchy-changed, synthetically mark the toplevel
    as not anchored, this allows the hierarchy changed propagation to
    recurse properly.

GtkWidget also takes care to unset the parent window *after* unparenting
the widget and after emitting the heirarhcy changed that leaves a NULL
toplevel.

That means there are now 2 cycles of "hierarchy-changed" when removing
an embedded toplevel from a parent, first one that makes the new toplevel
a NULL one (since the toplevel flag is not yet restored), the second cycle
makes the removed window toplevel again when setting the parent window
to NULL.
gtk/gtkwidget.c
gtk/gtkwindow.c