diff options
author | Shawn Betts <sabetts@gmail.com> | 2009-07-04 20:58:21 -0700 |
---|---|---|
committer | Shawn Betts <sabetts@gmail.com> | 2009-07-04 20:58:21 -0700 |
commit | 14beabe55fa3cac03f598e138f363f1d50659564 (patch) | |
tree | 2a23a383df0a818d60593e34d7dd73f1d408658a /src/screen.c | |
parent | 166021512b2e39344ff4562323d15a1e2fdea153 (diff) | |
download | ratpoison-winliststyle-row_broken.zip |
fix inverted text when using xftwinliststyle-row_broken
Now the inverted rectangle is drawn first and the text overtop in the bg color.
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/src/screen.c b/src/screen.c index ed7376a..aaf7bd8 100644 --- a/src/screen.c +++ b/src/screen.c @@ -309,6 +309,12 @@ init_screen (rp_screen *s, int screen_num) GCForeground | GCBackground | GCFunction | GCLineWidth | GCSubwindowMode, &gv); + gv.foreground = s->bg_color; + gv.background = s->fg_color; + s->inverse_gc = XCreateGC(dpy, s->root, + GCForeground | GCBackground | GCFunction + | GCLineWidth | GCSubwindowMode, + &gv); /* Create the program bar window. */ s->bar_is_raised = 0; @@ -344,23 +350,30 @@ init_screen (rp_screen *s, int screen_num) #ifdef USE_XFT_FONT { - if (!XftColorAllocName (dpy, DefaultVisual (dpy, screen_num), - DefaultColormap (dpy, screen_num), - defaults.fgcolor_string, &s->xft_color)) - { - PRINT_ERROR(("Failed to allocate font color\n")); - s->xft_font = NULL; - } - else - { - s->xft_font = XftFontOpenName (dpy, screen_num, DEFAULT_XFT_FONT); - if (!s->xft_font) - { - PRINT_ERROR(("Failed to open font\n")); - XftColorFree (dpy, DefaultVisual (dpy, screen_num), - DefaultColormap (dpy, screen_num), &s->xft_color); - } - } + s->xft_font = XftFontOpenName (dpy, screen_num, DEFAULT_XFT_FONT); + if (!s->xft_font) + { + PRINT_ERROR(("Failed to open font\n")); + } + else + { + if (!XftColorAllocName (dpy, DefaultVisual (dpy, screen_num), + DefaultColormap (dpy, screen_num), + defaults.fgcolor_string, &s->xft_fg_color)) + { + PRINT_ERROR(("Failed to allocate font fg color\n")); + XftFontClose (dpy, s->xft_font); + s->xft_font = NULL; + } + if (!XftColorAllocName (dpy, DefaultVisual (dpy, screen_num), + DefaultColormap (dpy, screen_num), + defaults.bgcolor_string, &s->xft_bg_color)) + { + PRINT_ERROR(("Failed to allocate font fg color\n")); + XftFontClose (dpy, s->xft_font); + s->xft_font = NULL; + } + } } #endif } |