52 lines
1.3 KiB
Diff
52 lines
1.3 KiB
Diff
changeset: 54:b1c48ddc01d9
|
|
tag: tip
|
|
user: "Daniel P. Berrange <berrange@redhat.com>"
|
|
date: Wed Aug 22 15:10:12 2007 -0400
|
|
files: src/vncdisplay.c
|
|
description:
|
|
Clear excess space in widget
|
|
|
|
|
|
diff -r f6b6e9e2ac43 -r b1c48ddc01d9 src/vncdisplay.c
|
|
--- a/src/vncdisplay.c Wed Aug 22 15:09:58 2007 -0400
|
|
+++ b/src/vncdisplay.c Wed Aug 22 15:10:12 2007 -0400
|
|
@@ -103,6 +103,8 @@ static gboolean expose_event(GtkWidget *
|
|
VncDisplay *obj = VNC_DISPLAY(widget);
|
|
VncDisplayPrivate *priv = obj->priv;
|
|
int x, y, w, h;
|
|
+ GdkRectangle drawn;
|
|
+ GdkRegion *clear, *copy;
|
|
|
|
if (priv->shm_image == NULL)
|
|
return TRUE;
|
|
@@ -114,9 +116,27 @@ static gboolean expose_event(GtkWidget *
|
|
w -= x;
|
|
h -= y;
|
|
|
|
+ drawn.x = x;
|
|
+ drawn.y = y;
|
|
+ drawn.width = w;
|
|
+ drawn.height = h;
|
|
+
|
|
+ clear = gdk_region_rectangle(&expose->area);
|
|
+ copy = gdk_region_rectangle(&drawn);
|
|
+ gdk_region_subtract(clear, copy);
|
|
+
|
|
+ gdk_gc_set_clip_region(priv->gc, copy);
|
|
vnc_shm_image_draw(priv->shm_image, widget->window,
|
|
- priv->gc,
|
|
+ priv->gc,
|
|
x, y, x, y, w, h);
|
|
+
|
|
+ gdk_gc_set_clip_region(priv->gc, clear);
|
|
+ gdk_draw_rectangle(widget->window, priv->gc, TRUE, expose->area.x, expose->area.y,
|
|
+ expose->area.width, expose->area.height);
|
|
+
|
|
+ gdk_region_destroy(clear);
|
|
+ gdk_region_destroy(copy);
|
|
+
|
|
return TRUE;
|
|
}
|
|
|
|
|