[gtk+] gdkwindow: Apply the 0x0 size bump to 1x1 before checking for the bail
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdkwindow: Apply the 0x0 size bump to 1x1 before checking for the bail
- Date: Thu, 3 Jul 2014 15:55:49 +0000 (UTC)
commit ec140a8f07e7b494c3354ee4f1015b6531949098
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jul 3 11:48:24 2014 -0400
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.
gdk/gdkwindow.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 0de26c1..15d8f0a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]