[PATCH] window: check previous window size in idle_resize

juan.j.zhao at linux.intel.com juan.j.zhao at linux.intel.com
Wed Feb 1 12:35:10 PST 2012


From: Juan Zhao <juan.j.zhao at linux.intel.com>

When sceduling redraw, the checking will use previous window size
 before resize_handler is called. Because resize_handler may change
 the window size.
For example, in the flower, the resize_handler will set the window
 size to make widget and window size the same.
This patch is some bug fixing for we can not see the output of flower
 in the screen.
---
 clients/window.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index d10662b..046ed7c 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2024,8 +2024,11 @@ idle_resize(struct task *task, uint32_t events)
 	struct window *window =
 		container_of(task, struct window, resize_task);
 	struct widget *widget;
+	uint32_t width, height;
 
 	window->resize_scheduled = 0;
+	width = window->allocation.width;
+	height = window->allocation.height;
 	widget = window->widget;
 	widget_set_allocation(widget,
 			      window->pending_allocation.x,
@@ -2039,8 +2042,8 @@ idle_resize(struct task *task, uint32_t events)
 				       widget->allocation.height,
 				       widget->user_data);
 
-	if (window->allocation.width != widget->allocation.width ||
-	    window->allocation.height != widget->allocation.height) {
+	if ( width != widget->allocation.width ||
+	     height != widget->allocation.height) {
 		window->allocation = widget->allocation;
 		window_schedule_redraw(window);
 	}
-- 
1.7.2.2



More information about the wayland-devel mailing list