From 0c8511d269b70279eafe6619f297c13f2a07ad85 Mon Sep 17 00:00:00 2001 From: Soeren Sandmann Date: Fri, 18 Jul 2003 22:12:51 +0000 Subject: [PATCH] Fix C99 declaration Sat Jul 19 00:18:40 2003 Soeren Sandmann * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 declaration * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function (gtk_widget_real_focus_{in|out}_event): queue shallow draws instead of full draws. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtkwidget.c | 32 +++++++++++++++++++++++--------- gtk/gtkwindow.c | 4 +++- 7 files changed, 71 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b4167b91d..797174305f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Sat Jul 19 00:18:40 2003 Soeren Sandmann + + * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 + declaration + + * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function + (gtk_widget_real_focus_{in|out}_event): queue shallow draws + instead of full draws. + 2003-07-18 Matthias Clasen * gtk/gtkwindow.c: Add properties decorated and gravity. (#80234) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6b4167b91d..797174305f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sat Jul 19 00:18:40 2003 Soeren Sandmann + + * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 + declaration + + * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function + (gtk_widget_real_focus_{in|out}_event): queue shallow draws + instead of full draws. + 2003-07-18 Matthias Clasen * gtk/gtkwindow.c: Add properties decorated and gravity. (#80234) diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6b4167b91d..797174305f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sat Jul 19 00:18:40 2003 Soeren Sandmann + + * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 + declaration + + * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function + (gtk_widget_real_focus_{in|out}_event): queue shallow draws + instead of full draws. + 2003-07-18 Matthias Clasen * gtk/gtkwindow.c: Add properties decorated and gravity. (#80234) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6b4167b91d..797174305f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sat Jul 19 00:18:40 2003 Soeren Sandmann + + * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 + declaration + + * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function + (gtk_widget_real_focus_{in|out}_event): queue shallow draws + instead of full draws. + 2003-07-18 Matthias Clasen * gtk/gtkwindow.c: Add properties decorated and gravity. (#80234) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6b4167b91d..797174305f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sat Jul 19 00:18:40 2003 Soeren Sandmann + + * gtk/gtkwindow.c (gtk_window_set_default_icon): Fix C99 + declaration + + * gtk/gtkwidget.c (gtk_widget_queue_shallow_draw): new function + (gtk_widget_real_focus_{in|out}_event): queue shallow draws + instead of full draws. + 2003-07-18 Matthias Clasen * gtk/gtkwindow.c: Add properties decorated and gravity. (#80234) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index d56c00be75..6f080adb1c 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -216,6 +216,7 @@ static AtkObject* gtk_widget_ref_accessible (AtkImplementor *implementor); static void gtk_widget_invalidate_widget_windows (GtkWidget *widget, GdkRegion *region); static GdkScreen * gtk_widget_get_screen_unchecked (GtkWidget *widget); +static void gtk_widget_queue_shallow_draw (GtkWidget *widget); static void gtk_widget_set_usize_internal (GtkWidget *widget, gint width, @@ -2253,16 +2254,10 @@ gtk_widget_queue_clear (GtkWidget *widget) void gtk_widget_queue_resize (GtkWidget *widget) { - GdkRegion *region; - g_return_if_fail (GTK_IS_WIDGET (widget)); if (GTK_WIDGET_REALIZED (widget)) - { - region = gdk_region_rectangle (&widget->allocation); - gtk_widget_invalidate_widget_windows (widget, region); - gdk_region_destroy (region); - } + gtk_widget_queue_shallow_draw (widget); _gtk_size_group_queue_resize (widget); } @@ -2414,6 +2409,25 @@ gtk_widget_invalidate_widget_windows (GtkWidget *widget, invalidate_predicate, widget); } +/** + * gtk_widget_queue_shallow_draw: + * @widget: a #GtkWidget + * + * Like gtk_widget_queue_draw(), but only windows owned + * by @widget are invalidated. + **/ +static void +gtk_widget_queue_shallow_draw (GtkWidget *widget) +{ + GdkRegion *region; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + + region = gdk_region_rectangle (&widget->allocation); + gtk_widget_invalidate_widget_windows (widget, region); + gdk_region_destroy (region); +} + /** * gtk_widget_size_allocate: * @widget: a #GtkWidget @@ -3045,7 +3059,7 @@ static gboolean gtk_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event) { - gtk_widget_queue_draw (widget); + gtk_widget_queue_shallow_draw (widget); return FALSE; } @@ -3054,7 +3068,7 @@ static gboolean gtk_widget_real_focus_out_event (GtkWidget *widget, GdkEventFocus *event) { - gtk_widget_queue_draw (widget); + gtk_widget_queue_shallow_draw (widget); return FALSE; } diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 8de5823362..75852bf4df 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2841,9 +2841,11 @@ gtk_window_set_default_icon_list (GList *list) void gtk_window_set_default_icon (GdkPixbuf *pixbuf) { + GList *list; + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); - GList *list = g_list_prepend (NULL, pixbuf); + list = g_list_prepend (NULL, pixbuf); gtk_window_set_default_icon_list (list); g_list_free (list); }