[PATCH] window: check previous window size in idle_resize

Kristian Høgsberg krh at bitplanet.net
Wed Feb 8 11:50:23 PST 2012


On Wed, Feb 1, 2012 at 3:35 PM,  <juan.j.zhao at linux.intel.com> wrote:
> 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.

Thanks for tracking this down.  However, the problem is that we
shouldn't set the window size in widget_set_size() and smoke should
really just use the regular window.c resize code.  I've fixed those
problems and smoke runs again.

Kristian

> ---
>  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