From 62c9c5f3a952b9d234b2f7510aea87932aa9db63 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 1 Nov 2005 12:16:49 +0000 Subject: [PATCH] (xft_render): Check xft_draw's drawable before changing it. (mwin__destroy_window): If xft_draw's drawable is win, change it to device->drawable before destroying win. --- src/m17n-X.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/m17n-X.c b/src/m17n-X.c index a09bc8b..ad77bc2 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -1246,7 +1246,8 @@ xft_render (MDrawWindow win, int x, int y, } } - XftDrawChange (xft_draw, (Drawable) win); + if (XftDrawDrawable (xft_draw) != (Drawable) win) + XftDrawChange (xft_draw, (Drawable) win); XftDrawSetClip (xft_draw, (Region) region); y -= rfont->baseline_offset; @@ -1716,6 +1717,12 @@ mwin__create_window (MFrame *frame, MDrawWindow parent) static void mwin__destroy_window (MFrame *frame, MDrawWindow win) { +#ifdef HAVE_XFT2 + XftDraw *xft_draw = FRAME_DEVICE (frame)->xft_draw; + + if (XftDrawDrawable (xft_draw) == (Drawable) win) + XftDrawChange (xft_draw, FRAME_DEVICE (frame)->drawable); +#endif /* HAVE_XFT2 */ XDestroyWindow (FRAME_DISPLAY (frame), (Window) win); } -- 1.7.10.4