summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-12-15 12:10:03 +0000
committersabetts <sabetts>2000-12-15 12:10:03 +0000
commita481519bb485333093c9bd59a3907d21fb16bce0 (patch)
tree58f585a2294a05ea0ac68113a6a6024e58307f7f /src
parentef1d2c75350354abe4aac9935af501306a667707 (diff)
downloadratpoison-a481519bb485333093c9bd59a3907d21fb16bce0.zip
* list.c (set_active_window): Installs colormap
(set_active_window): sets rp_current_window to window passed in as parameter * list.c (add_to_window_list): sets member colormap to the DefaultColormap * list.c (add_to_window_list): Added init code for `hints'
Diffstat (limited to 'src')
-rw-r--r--src/list.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/list.c b/src/list.c
index ad6ee5b..72f6373 100644
--- a/src/list.c
+++ b/src/list.c
@@ -47,7 +47,8 @@ add_to_window_list (screen_info *s, Window w)
new_window->number = -1;
new_window->named = 0;
new_window->hints = XAllocSizeHints ();
-
+ new_window->colormap = DefaultColormap (dpy, s->screen_num);
+
if ((new_window->name = malloc (strlen ("Unnamed") + 1)) == NULL)
{
PRINT_ERROR ("Out of memory!\n");
@@ -167,8 +168,7 @@ goto_window_name (char *name)
return 0;
}
- rp_current_window = win;
- set_active_window (rp_current_window);
+ set_active_window (win);
return 1;
}
@@ -218,6 +218,15 @@ set_active_window (rp_window *rp_w)
XSetInputFocus (dpy, rp_w->w,
RevertToPointerRoot, CurrentTime);
XRaiseWindow (dpy, rp_w->w);
+
+ /* Swap colormaps */
+ if (rp_current_window != NULL)
+ {
+ XUninstallColormap (dpy, rp_current_window->colormap);
+ }
+ XInstallColormap (dpy, rp_w->colormap);
+
+ rp_current_window = rp_w;
/* Make sure the program bar is always on the top */
update_window_names (rp_w->scr);