summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>1997-12-12 20:03:48 +0000
committerOwen Taylor <otaylor@src.gnome.org>1997-12-12 20:03:48 +0000
commitd30343b9d9eb505fcd5985e67931d685e86ad0a3 (patch)
treeb455dbd82592620c1a944aaf83a178c6061f3d8e /gdk
parent30e8968f3b8a82229b87a8789dcbd7b462189611 (diff)
downloadgtk+-d30343b9d9eb505fcd5985e67931d685e86ad0a3.tar.gz
gdk/gdkgc.c: If gdk_gc_set_clip_rectangle is called with
rectangle = NULL, remove clip mask, instead of segfaulting. gtk/gtknotebook.c: Set clip mask before redrawing, so that we don't overwrite things outside of exposed areas when drawing the shadows. (Based on a patch from Lars Hamann <hamann@braunschweig.netsurf.de> and Stefan Jeske) -owt
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkgc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
index 8ee9fdc359..a7bf8520d2 100644
--- a/gdk/gdkgc.c
+++ b/gdk/gdkgc.c
@@ -535,13 +535,18 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
private = (GdkGCPrivate*) gc;
- xrectangle.x = rectangle->x;
- xrectangle.y = rectangle->y;
- xrectangle.width = rectangle->width;
- xrectangle.height = rectangle->height;
-
- XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
- &xrectangle, 1, Unsorted);
+ if (rectangle)
+ {
+ xrectangle.x = rectangle->x;
+ xrectangle.y = rectangle->y;
+ xrectangle.width = rectangle->width;
+ xrectangle.height = rectangle->height;
+
+ XSetClipRectangles (private->xdisplay, private->xgc, 0, 0,
+ &xrectangle, 1, Unsorted);
+ }
+ else
+ XSetClipMask (private->xdisplay, private->xgc, None);
}
void