diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-07-31 20:21:20 -0700 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2015-07-31 20:39:02 -0700 |
commit | 93171cf4f346c0a5e71f274d012c3cacfe3880ba (patch) | |
tree | 51e304de772b00c62e10d10efe2882fff68fb1fb /gtk/gtkoverlay.c | |
parent | 9f24b54786d8371f77f9ba0c4475ed82b2e0e68f (diff) | |
download | gtk+-93171cf4f346c0a5e71f274d012c3cacfe3880ba.tar.gz |
gtkoverlay: Optimize size allocations
Doing raises / lowers here will invalidate the entire child widget
almost every time, since raising each widget causes it to invalidate
that area.
Diffstat (limited to 'gtk/gtkoverlay.c')
-rw-r--r-- | gtk/gtkoverlay.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index 0c4a6dc999..48278e5004 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -302,11 +302,8 @@ gtk_overlay_child_allocate (GtkOverlay *overlay, if (gtk_widget_get_mapped (GTK_WIDGET (overlay))) { - /* Note: This calls show every size allocation, which makes - * us keep the z-order of the chilren, as gdk_window_show() - * does an implicit raise. */ if (gtk_widget_get_visible (child->widget)) - gdk_window_show (child->window); + gdk_window_show_unraised (child->window); else if (gdk_window_is_visible (child->window)) gdk_window_hide (child->window); } @@ -590,6 +587,16 @@ gtk_overlay_reorder_overlay (GtkOverlay *overlay, if (index == old_index) return; + if (new_link) + { + GtkOverlayChild *new_child_info = new_link->data; + gdk_window_restack (child_info->window, new_child_info->window, TRUE); + } + else + { + gdk_window_raise (child_info->window); + } + priv->children = g_slist_delete_link (priv->children, old_link); priv->children = g_slist_insert_before (priv->children, new_link, child_info); |