summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 18:32:13 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 18:32:13 +0000
commita161af0a883b08f88d3f15781b8c4b1957bd5819 (patch)
tree55a9d00944a338f2bcaef61de59a9ab20cfd9985 /ui/gfx
parentb11279e2abfc427e30f0ccaa8e265f5ebbb63b3c (diff)
downloadchromium_src-a161af0a883b08f88d3f15781b8c4b1957bd5819.zip
chromium_src-a161af0a883b08f88d3f15781b8c4b1957bd5819.tar.gz
chromium_src-a161af0a883b08f88d3f15781b8c4b1957bd5819.tar.bz2
Send resize message to children.
GtkPreserveWindow now resizes it's children when the resize is delegated (i.e. defered to synchronize with the GPU process). BUG=84743 TEST=Go to http://www.hulu.com/watch/205356/family-guy-new-kidney-in-town#s-p1-so-i0 with --force-compositing-mode. Video should play. Review URL: http://codereview.chromium.org/7112033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/gtk_preserve_window.cc37
1 files changed, 29 insertions, 8 deletions
diff --git a/ui/gfx/gtk_preserve_window.cc b/ui/gfx/gtk_preserve_window.cc
index 8348c90..d67bc92 100644
--- a/ui/gfx/gtk_preserve_window.cc
+++ b/ui/gfx/gtk_preserve_window.cc
@@ -189,17 +189,38 @@ void gtk_preserve_window_set_preserve(GtkPreserveWindow* window,
void gtk_preserve_window_size_allocate(GtkWidget* widget,
GtkAllocation* allocation) {
g_return_if_fail(GTK_IS_PRESERVE_WINDOW(widget));
- GtkPreserveWindowPrivate* priv = GTK_PRESERVE_WINDOW_GET_PRIVATE(widget);
- if (priv->delegate_resize) {
- widget->allocation = *allocation;
- // Only update the position. Someone else will call gdk_window_resize.
- if (GTK_WIDGET_REALIZED(widget)) {
+ widget->allocation = *allocation;
+
+ if (GTK_WIDGET_REALIZED(widget)) {
+ GtkPreserveWindowPrivate* priv = GTK_PRESERVE_WINDOW_GET_PRIVATE(widget);
+ if (priv->delegate_resize) {
gdk_window_move(widget->window, allocation->x, allocation->y);
+ } else {
+ gdk_window_move_resize(
+ widget->window, allocation->x, allocation->y,
+ allocation->width, allocation->height);
}
- } else {
- GTK_WIDGET_CLASS(gtk_preserve_window_parent_class)->size_allocate(
- widget, allocation);
+ }
+
+ // Propagate resize to children
+ guint16 border_width = GTK_CONTAINER(widget)->border_width;
+ GList *children = GTK_FIXED(widget)->children;
+ while (children) {
+ GtkFixedChild *child = reinterpret_cast<GtkFixedChild*>(children->data);
+ if (gtk_widget_get_visible(child->widget)) {
+ GtkRequisition child_requisition;
+ gtk_widget_get_child_requisition(child->widget, &child_requisition);
+
+ GtkAllocation child_allocation;
+ child_allocation.x = child->x + border_width;
+ child_allocation.y = child->y + border_width;
+ child_allocation.width = child_requisition.width;
+ child_allocation.height = child_requisition.height;
+
+ gtk_widget_size_allocate(child->widget, &child_allocation);
+ }
+ children = children->next;
}
}