commit 1da63ef2c943d5dce6348e74719cfa52c8cb9206
parent 5634105a41bb377fd18c759f63cca8b739e403eb
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Thu, 2 Feb 2006 21:08:34 +0200
fixed trans color usage
Diffstat:
3 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c
@@ -829,6 +829,8 @@ xwrite(IXPConn *c)
}
memcpy(def.selcolor, c->fcall->data, c->fcall->count);
def.selcolor[c->fcall->count] = 0;
+ blitz_loadcolor(dpy, screen, def.selcolor, &def.sel);
+ XSetForeground(dpy, gc_xor, def.sel.bg);
/* TODO: update color */
break;
case Fnormcolor:
@@ -841,6 +843,7 @@ xwrite(IXPConn *c)
}
memcpy(def.normcolor, c->fcall->data, c->fcall->count);
def.normcolor[c->fcall->count] = 0;
+ blitz_loadcolor(dpy, screen, def.normcolor, &def.norm);
/* TODO: update color */
break;
case Fsnap:
diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c
@@ -500,17 +500,6 @@ win_state(Window w)
return res;
}
-/* load color stuff */
-/*
- unsigned long col[1];
- col[0] = color_xor.pixel;
- XFreeColors(dpy, DefaultColormap(dpy, screen), col, 1, 0);
- XAllocNamedColor(dpy, DefaultColormap(dpy, screen),
- def[WM_TRANS_COLOR]->content,
- &color_xor, &color_xor);
- XSetForeground(dpy, gc_xor, color_xor.pixel);
- */
-
static void
init_atoms()
{
@@ -548,13 +537,9 @@ init_screen()
XGCValues gcv;
XSetWindowAttributes wa;
- def.selcolor[7] = 0;
- XAllocNamedColor(dpy, DefaultColormap(dpy, screen),
- def.selcolor, &color_xor, &color_xor);
- def.selcolor[7] = ' ';
gcv.subwindow_mode = IncludeInferiors;
gcv.function = GXxor;
- gcv.foreground = color_xor.pixel;
+ gcv.foreground = def.sel.bg;
gcv.line_width = 4;
gcv.plane_mask = AllPlanes;
gcv.graphics_exposures = False;
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -114,7 +114,6 @@ Window root;
Window transient; /* pager / attach */
XRectangle rect;
XFontStruct *xfont;
-XColor color_xor;
GC gc_xor;
GC gc_transient;
IXPServer srv;