From: handa Date: Mon, 29 Mar 2004 03:52:04 +0000 (+0000) Subject: (mwin__create_window): Fix bug of setting a background X-Git-Tag: REL-1-0-2~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=535dafc50578cddc11e6c53d9b47118c6cb7fef7;p=m17n%2Fm17n-lib.git (mwin__create_window): Fix bug of setting a background pixel of a new window. (mwin__adjust_window): Clear the window before drawing. --- 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