From: handa Date: Tue, 1 Nov 2005 12:16:49 +0000 (+0000) Subject: (xft_render): Check xft_draw's drawable before changing X-Git-Tag: REL-1-3-0~99 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62c9c5f3a952b9d234b2f7510aea87932aa9db63;p=m17n%2Fm17n-lib.git (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. --- 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); }