From f10df85cd734b2dc450e1addc6964722c90b41f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 28 Feb 2012 21:52:12 -0500 Subject: [PATCH] window: Set opaque region after child widget adjusts size --- clients/window.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/clients/window.c b/clients/window.c index 04692c0..5ad3425 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1191,15 +1191,6 @@ frame_resize_handler(struct widget *widget, opaque_margin = 0; } - if (child->opaque) { - widget->window->opaque_region = - wl_compositor_create_region(display->compositor); - wl_region_add(widget->window->opaque_region, - opaque_margin, opaque_margin, - width - 2 * opaque_margin, - height - 2 * opaque_margin); - } - widget_set_allocation(child, allocation.x, allocation.y, allocation.width, allocation.height); @@ -1212,6 +1203,15 @@ frame_resize_handler(struct widget *widget, widget_set_allocation(widget, 0, 0, child->allocation.width + decoration_width, child->allocation.height + decoration_height); + + if (child->opaque) { + widget->window->opaque_region = + wl_compositor_create_region(display->compositor); + wl_region_add(widget->window->opaque_region, + opaque_margin, opaque_margin, + widget->allocation.width - 2 * opaque_margin, + widget->allocation.height - 2 * opaque_margin); + } } static void -- 2.7.4