diff options
author | Owen Taylor <otaylor@redhat.com> | 2005-02-11 22:39:19 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2005-02-11 22:39:19 +0000 |
commit | c85ee0c830d2ed6cb6bbccfb99ba519569f1e952 (patch) | |
tree | 1c5f43e58da46285d53afaf8fd3fc1954c35b972 | |
parent | d6386f036fe357901c0f06b3234420f1cf58c4b2 (diff) | |
download | gtk+-rendering-demo.tar.gz |
Don't queue a redraw if the size didn't change. queue a shallow redraw.rendering-demo
2005-02-11 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Don't queue
a redraw if the size didn't change. queue a shallow redraw.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 5 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 5 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 10 |
4 files changed, 23 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2005-02-11 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwindow.c (gtk_window_size_allocate): Don't queue + a redraw if the size didn't change. queue a shallow redraw. + 2005-02-10 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c: Add a resizable-background style property diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8d80c4c739..a6480168d7 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-02-11 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwindow.c (gtk_window_size_allocate): Don't queue + a redraw if the size didn't change. queue a shallow redraw. + 2005-02-10 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c: Add a resizable-background style property diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8d80c4c739..a6480168d7 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-02-11 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkwindow.c (gtk_window_size_allocate): Don't queue + a redraw if the size didn't change. queue a shallow redraw. + 2005-02-10 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c: Add a resizable-background style property diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 75e6e7d50b..72f15b60ff 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4217,8 +4217,14 @@ gtk_window_size_allocate (GtkWidget *widget, { GtkWindow *window; GtkAllocation child_allocation; + gboolean allocation_changed = FALSE; window = GTK_WINDOW (widget); + + if (allocation->width != widget->allocation.width || + allocation->height != widget->allocation.height) + allocation_changed = TRUE; + widget->allocation = *allocation; if (window->bin.child && GTK_WIDGET_VISIBLE (window->bin.child)) @@ -4240,7 +4246,7 @@ gtk_window_size_allocate (GtkWidget *widget, allocation->height + window->frame_top + window->frame_bottom); } - if (GTK_WIDGET_REALIZED (widget)) + if (allocation_changed && GTK_WIDGET_REALIZED (widget)) { gboolean resizable_background; @@ -4249,7 +4255,7 @@ gtk_window_size_allocate (GtkWidget *widget, NULL); if (resizable_background) - gtk_widget_queue_draw (widget); + gdk_window_invalidate_rect (widget->window, NULL, FALSE); } } |