aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2010-02-13 14:27:32 +0100
committerJan Djärv2010-02-13 14:27:32 +0100
commit471e4f044041f16e50c4e817d3fa0249b8e84748 (patch)
treed5c9a52fb734d1adb9f0187949f3012c26719e8c
parent98599f74d03c2dd4b6ac90d68266c508c5e0342e (diff)
downloademacs-471e4f044041f16e50c4e817d3fa0249b8e84748.tar.gz
emacs-471e4f044041f16e50c4e817d3fa0249b8e84748.zip
xterm.c (XTflash): Use Gdk-routines if USE_GTK so scroll bars doesn't get
overdrawn.
-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 a48194a90aa..c6de809eb81 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,9 @@
12010-02-13 Jan Djärv <jan.h.d@swipnet.se> 12010-02-13 Jan Djärv <jan.h.d@swipnet.se>
2 2
3 * xterm.c (x_clear_frame_area): Cal gtk_widget_queue_draw if USE_GTK, 3 * xterm.c (x_clear_frame_area): Call gtk_widget_queue_draw if USE_GTK,
4 bug #5571. 4 bug #5571.
5 (XTflash): Use Gdk-routines if USE_GTK so scroll bars doesn't get
6 overdrawn.
5 7
62010-02-10 Jan Djärv <jan.h.d@swipnet.se> 82010-02-10 Jan Djärv <jan.h.d@swipnet.se>
7 9
diff --git a/src/xterm.c b/src/xterm.c
index 9ed98deb7b5..b4a04195430 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3015,6 +3015,21 @@ XTflash (f)
3015 BLOCK_INPUT; 3015 BLOCK_INPUT;
3016 3016
3017 { 3017 {
3018#ifdef USE_GTK
3019 /* Use Gdk routines to draw. This way, we won't draw over scroll bars
3020 when the scroll bars and the edit widget share the same X window. */
3021 GdkGCValues vals;
3022 vals.foreground.pixel = (FRAME_FOREGROUND_PIXEL (f)
3023 ^ FRAME_BACKGROUND_PIXEL (f));
3024 vals.function = GDK_XOR;
3025 GdkGC *gc = gdk_gc_new_with_values (FRAME_GTK_WIDGET (f)->window,
3026 &vals,
3027 GDK_GC_FUNCTION
3028 | GDK_GC_FOREGROUND);
3029#define XFillRectangle(d, win, gc, x, y, w, h) \
3030 gdk_draw_rectangle (FRAME_GTK_WIDGET (f)->window, \
3031 gc, TRUE, x, y, w, h)
3032#else
3018 GC gc; 3033 GC gc;
3019 3034
3020 /* Create a GC that will use the GXxor function to flip foreground 3035 /* Create a GC that will use the GXxor function to flip foreground
@@ -3029,7 +3044,7 @@ XTflash (f)
3029 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3044 gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3030 GCFunction | GCForeground, &values); 3045 GCFunction | GCForeground, &values);
3031 } 3046 }
3032 3047#endif
3033 { 3048 {
3034 /* Get the height not including a menu bar widget. */ 3049 /* Get the height not including a menu bar widget. */
3035 int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); 3050 int height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
@@ -3072,6 +3087,7 @@ XTflash (f)
3072 (height - flash_height 3087 (height - flash_height
3073 - FRAME_INTERNAL_BORDER_WIDTH (f)), 3088 - FRAME_INTERNAL_BORDER_WIDTH (f)),
3074 width, flash_height); 3089 width, flash_height);
3090
3075 } 3091 }
3076 else 3092 else
3077 /* If it is short, flash it all. */ 3093 /* If it is short, flash it all. */
@@ -3133,7 +3149,12 @@ XTflash (f)
3133 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f), 3149 flash_left, FRAME_INTERNAL_BORDER_WIDTH (f),
3134 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)); 3150 width, height - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
3135 3151
3152#ifdef USE_GTK
3153 g_object_unref (G_OBJECT (gc));
3154#undef XFillRectangle
3155#else
3136 XFreeGC (FRAME_X_DISPLAY (f), gc); 3156 XFreeGC (FRAME_X_DISPLAY (f), gc);
3157#endif
3137 x_flush (f); 3158 x_flush (f);
3138 } 3159 }
3139 } 3160 }