From 535dafc50578cddc11e6c53d9b47118c6cb7fef7 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 29 Mar 2004 03:52:04 +0000 Subject: [PATCH] (mwin__create_window): Fix bug of setting a background pixel of a new window. (mwin__adjust_window): Clear the window before drawing. --- src/m17n-X.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/m17n-X.c b/src/m17n-X.c index 9218881..76093b1 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -1845,14 +1845,16 @@ mwin__create_window (MFrame *frame, MDrawWindow parent) Window win; XWMHints wm_hints = { InputHint, False }; XClassHint class_hints = { "M17N-IM", "m17n-im" }; - XWindowAttributes win_attrs; XSetWindowAttributes set_attrs; unsigned long mask; + XGCValues values; + GCInfo *info = frame->rface->info; if (! parent) parent = (MDrawWindow) RootWindow (display, FRAME_SCREEN (frame)); - XGetWindowAttributes (display, (Window) parent, &win_attrs); - set_attrs.background_pixel = win_attrs.backing_pixel; + mask = GCForeground; + XGetGCValues (display, info->gc[GC_INVERSE], mask, &values); + set_attrs.background_pixel = values.foreground; set_attrs.backing_store = Always; set_attrs.override_redirect = True; set_attrs.save_under = True; @@ -2007,6 +2009,7 @@ mwin__adjust_window (MFrame *frame, MDrawWindow win, } if (mask) XConfigureWindow (display, (Window) win, mask, &values); + XClearWindow (display, (Window) win); } MSymbol -- 1.7.10.4