gdkwindow: Apply the 0x0 size bump to 1x1 before checking for the bail

Otherwise, a user that calls gdk_window_resize (window, 0, 0); over and
over won't properly fizzle out, and will queue a redraw. Clipped, but
still. These redraws can be chatty on some platforms like Wayland, and
there's no good reason to not avoid them.

This was the case for resize grips.
This commit is contained in:
Jasper St. Pierre 2014-07-03 11:48:24 -04:00
parent ed273e7518
commit ec140a8f07

View File

@ -5355,6 +5355,11 @@ gdk_window_move_resize_internal (GdkWindow *window,
return;
}
if (width == 0)
width = 1;
if (height == 0)
height = 1;
/* Bail early if no change */
if (window->width == width &&
window->height == height &&
@ -5386,11 +5391,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
}
if (!(width < 0 && height < 0))
{
if (width < 1)
width = 1;
window->width = width;
if (height < 1)
height = 1;
window->height = height;
}