aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2010-02-13 14:27:32 +0100
committerJan Djärv <[email protected]>2010-02-13 14:27:32 +0100
commit471e4f044041f16e50c4e817d3fa0249b8e84748 (patch)
treed5c9a52fb734d1adb9f0187949f3012c26719e8c /src
parent98599f74d03c2dd4b6ac90d68266c508c5e0342e (diff)
xterm.c (XTflash): Use Gdk-routines if USE_GTK so scroll bars doesn't get
overdrawn.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xterm.c23
2 files changed, 25 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a48194a90a..c6de809eb8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,9 @@
2010-02-13 Jan Djärv <[email protected]>
- * xterm.c (x_clear_frame_area): Cal gtk_widget_queue_draw if USE_GTK,
+ * xterm.c (x_clear_frame_area): Call gtk_widget_queue_draw if USE_GTK,
bug #5571.
+ (XTflash): Use Gdk-routines if USE_GTK so scroll bars doesn't get
+ overdrawn.
2010-02-10 Jan Djärv <[email protected]>
diff --git a/src/xterm.c b/src/xterm.c
index 9ed98deb7b..b4a0419543 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3015,6 +3015,21 @@ XTflash (f)
BLOCK_INPUT;
{
+#ifdef USE_GTK
+ /* Use Gdk routines to draw. This way, we won't draw over scroll bars
+ when the scroll bars and the edit widget share the same X window. */
+ GdkGCValues vals;
+ vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
+ ^ FRAME_BACKGROUND_PIXEL (f));
+ vals.function = GDK_XOR;
+ GdkGC *gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
+ &vals,
+ GDK_GC_FUNCTION
+ | GDK_GC_FOREGROUND);
+#define XFillRectangle(d, win, gc, x, y, w, h) \
+ gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
+ gc, TRUE, x, y, w, h)
+#else
GC gc;
/* Create a GC that will use the GXxor function to flip foreground
@@ -3029,7 +3044,7 @@ XTflash (f)
gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
GCFunction | GCForeground, &values);
}
-
+#endif
{
/* Get the height not including a menu bar widget. */
int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
@@ -3072,6 +3087,7 @@ XTflash (f)
(height - flash_height
- FRAME_INTERNAL_BORDER_WIDTH (f)),
width, flash_height);
+
}
else
/* If it is short, flash it all. */
@@ -3133,7 +3149,12 @@ XTflash (f)
flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+#ifdef USE_GTK
+ g_object_unref (G_OBJECT (gc));
+#undef XFillRectangle
+#else
XFreeGC (FRAME_X_DISPLAY (f), gc);
+#endif
x_flush (f);
}
}