diff options
author | sabetts <sabetts> | 2000-12-15 12:09:42 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2000-12-15 12:09:42 +0000 |
commit | ef1d2c75350354abe4aac9935af501306a667707 (patch) | |
tree | 44b87a0d9be9e4f3fe811954e0cf19493edec728 /src/events.c | |
parent | bad67eae07f621c5ad2fee13169d734e0cf49bc5 (diff) | |
download | ratpoison-ef1d2c75350354abe4aac9935af501306a667707.zip |
* events.c: propagated changes to set_active_window usage
* events.c (property_notify): Added handler for XA_WM_NORMAL_HINTS.
Diffstat (limited to 'src/events.c')
-rw-r--r-- | src/events.c | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src/events.c b/src/events.c index 3450da2..31478ce 100644 --- a/src/events.c +++ b/src/events.c @@ -98,20 +98,27 @@ map_request (XEvent *ev) if (s && win) { + PRINT_DEBUG ("Map from a managable window\n"); + switch (win->state) { case STATE_UNMAPPED: + PRINT_DEBUG ("Unmapped window\n"); if (unmanaged_window (win->w)) { + PRINT_DEBUG ("Unmanaged Window\n"); XMapRaised (dpy, win->w); break; } else - manage (win, s); /* fall through */ + { + PRINT_DEBUG ("managed Window\n"); + manage (win, s); /* fall through */ + } case STATE_MAPPED: + PRINT_DEBUG ("Mapped Window\n"); XMapRaised (dpy, win->w); - rp_current_window = win; - set_active_window (rp_current_window); + set_active_window (win); } } else @@ -212,8 +219,7 @@ configure_request (XConfigureRequestEvent *e) { if (e->detail == Above) { - rp_current_window = win; - set_active_window (rp_current_window); + set_active_window (win); } else if (e->detail == Below && win == rp_current_window) { @@ -361,10 +367,8 @@ property_notify (XEvent *ev) { case XA_WM_NAME: PRINT_DEBUG ("updating window name\n"); - if (update_window_name (win)) - { - update_window_names (win->scr); - } + update_window_name (win); + update_window_names (win->scr); break; case XA_WM_NORMAL_HINTS: @@ -380,6 +384,27 @@ property_notify (XEvent *ev) } } +void +colormap_notify (XEvent *ev) +{ + rp_window *win; + + win = find_window (ev->xcolormap.window); + + if (win != NULL) + { + XWindowAttributes attr; + + XGetWindowAttributes (dpy, win->w, &attr); + win->colormap = attr.colormap; + + if (win == rp_current_window) + { + XInstallColormap (dpy, win->colormap); + } + } +} + /* Given an event, call the correct function to handle it. */ void delegate_event (XEvent *ev) @@ -407,6 +432,7 @@ delegate_event (XEvent *ev) break; case ColormapNotify: PRINT_DEBUG ("ColormapNotify\n"); + colormap_notify (ev); break; case PropertyNotify: PRINT_DEBUG ("PropertyNotify\n"); |