From ed1e531c3643784c16b338e64310c086323d6e45 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 17 Jun 1998 03:34:22 +0000 Subject: [PATCH] Now accepts an extra "clip" parameter, which is the clipping rectangle to 1998-06-16 Federico Mena Quintero * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra "clip" parameter, which is the clipping rectangle to use. This eliminates the extremely annoying flicker when exposing parts of the handlebox. --- ChangeLog | 7 ++++++ ChangeLog.pre-2-0 | 7 ++++++ ChangeLog.pre-2-10 | 7 ++++++ ChangeLog.pre-2-2 | 7 ++++++ ChangeLog.pre-2-4 | 7 ++++++ ChangeLog.pre-2-6 | 7 ++++++ ChangeLog.pre-2-8 | 7 ++++++ gtk/gtkhandlebox.c | 59 +++++++++++++++++++++++++--------------------- 8 files changed, 81 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6cff5b39d0..79e28b1e87 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +1998-06-16 Federico Mena Quintero + + * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra + "clip" parameter, which is the clipping rectangle to use. This + eliminates the extremely annoying flicker when exposing parts of + the handlebox. + Tue Jun 16 14:08:08 PDT 1998 Manish Singh * gtk/gtktable.c: fix from TimJ for off-by-one error in table diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index dc45477ce2..6a9e6ece85 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -611,44 +611,49 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb) } static void -draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow) +draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow, + GdkRectangle *clip) { int x, y; int xthick, ythick; GdkGC *light_gc, *dark_gc; + GdkRectangle dest; - gdk_draw_rectangle (window, - widget->style->bg_gc[GTK_STATE_NORMAL], - TRUE, - rect->x, rect->y, - rect->width, rect->height); + if (gdk_rectangle_intersect (rect, clip, &dest)) + { + gdk_draw_rectangle (window, + widget->style->bg_gc[GTK_STATE_NORMAL], + TRUE, + dest.x, dest.y, + dest.width, dest.height); - light_gc = widget->style->light_gc[GTK_STATE_NORMAL]; - dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL]; + light_gc = widget->style->light_gc[GTK_STATE_NORMAL]; + dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL]; - xthick = widget->style->klass->xthickness; - ythick = widget->style->klass->ythickness; + xthick = widget->style->klass->xthickness; + ythick = widget->style->klass->ythickness; - gdk_gc_set_clip_rectangle (light_gc, rect); - gdk_gc_set_clip_rectangle (dark_gc, rect); + gdk_gc_set_clip_rectangle (light_gc, &dest); + gdk_gc_set_clip_rectangle (dark_gc, &dest); - for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3) - for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6) - { - gdk_draw_point (window, light_gc, x, y); - gdk_draw_point (window, dark_gc, x + 1, y + 1); + for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3) + for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6) + { + gdk_draw_point (window, light_gc, x, y); + gdk_draw_point (window, dark_gc, x + 1, y + 1); - gdk_draw_point (window, light_gc, x + 3, y + 1); - gdk_draw_point (window, dark_gc, x + 4, y + 2); - } + gdk_draw_point (window, light_gc, x + 3, y + 1); + gdk_draw_point (window, dark_gc, x + 4, y + 2); + } - gdk_gc_set_clip_rectangle (light_gc, NULL); - gdk_gc_set_clip_rectangle (dark_gc, NULL); + gdk_gc_set_clip_rectangle (light_gc, NULL); + gdk_gc_set_clip_rectangle (dark_gc, NULL); - gtk_draw_shadow (widget->style, window, - GTK_STATE_NORMAL, shadow, - rect->x, rect->y, - rect->width, rect->height); + gtk_draw_shadow (widget->style, window, + GTK_STATE_NORMAL, shadow, + rect->x, rect->y, + rect->width, rect->height); + } } static void @@ -706,7 +711,7 @@ gtk_handle_box_paint (GtkWidget *widget, rect.width = (hb->handle_position == GTK_POS_LEFT) ? DRAG_HANDLE_SIZE : width; rect.height = (hb->handle_position == GTK_POS_TOP) ? DRAG_HANDLE_SIZE : height; - draw_textured_frame (widget, hb->bin_window, &rect, GTK_SHADOW_OUT); + draw_textured_frame (widget, hb->bin_window, &rect, GTK_SHADOW_OUT, event ? &event->area : area); if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) {