# $Id: ratpoison-1.4.0-panel.diff,v 1.3 2005/10/07 02:26:25 jcs Exp $ # # reserve 3 pixels at the bottom of the screen for an auto-hiding panel or # task bar (like xfce4-panel), handle unmanaged windows as always-on-top, and # always bring them to the top whenever they might get overlapped # # patch against ratpoison-1.4.0-beta4 # # by joshua stein # --- src/manage.h.orig Fri Dec 3 21:33:24 2004 +++ src/manage.h Wed Jun 1 09:56:45 2005 @@ -55,4 +55,6 @@ void unhide_window_below (rp_window *win void withdraw_window (rp_window *win); void hide_others (rp_window *win); +void raise_unmanaged (rp_screen *s); + #endif /* ! _RATPOISION_MANAGE_H */ --- src/manage.c.orig Mon Dec 6 01:26:47 2004 +++ src/manage.c Wed Jun 1 09:45:32 2005 @@ -917,3 +917,20 @@ hide_others (rp_window *win) hide_window (cur); } } + +void +raise_unmanaged (rp_screen *s) +{ + rp_window *win; + unsigned int i, nwins; + Window dw1, dw2, *wins; + + XQueryTree(dpy, s->root, &dw1, &dw2, &wins, &nwins); + for (i = 0; i < nwins; i++) + { + if (unmanaged_window (wins[i])) { + XMapRaised (dpy, wins[i]); + XRaiseWindow (dpy, wins[i]); + } + } +} --- src/screen.c.orig Fri Dec 3 21:33:24 2004 +++ src/screen.c Wed Jun 1 09:45:32 2005 @@ -246,6 +246,9 @@ init_screen (rp_screen *s, int screen_nu s->height = DisplayHeight(dpy, screen_num); } + /* Reserve space for the panel. */ + s->height -= 3; + /* Select on some events on the root window, if this fails, then there is already a WM running and the X Error handler will catch it, terminating ratpoison. */ --- src/actions.c.orig Sun Apr 10 14:25:28 2005 +++ src/actions.c Wed Jun 1 09:45:32 2005 @@ -4387,6 +4387,7 @@ frestore (char *data, rp_screen *s) set_active_frame (current_frame()); update_bar (s); show_frame_indicator(); + raise_unmanaged (s); PRINT_DEBUG (("Done.\n")); return cmdret_new (RET_SUCCESS, NULL); --- src/split.c.orig Fri Dec 3 21:33:24 2004 +++ src/split.c Wed Jun 1 09:45:32 2005 @@ -870,6 +870,8 @@ set_active_frame (rp_frame *frame) hook_run (&rp_switch_frame_hook); } + raise_unmanaged (s); + /* If the frame has no window to give focus to, give the key window focus. */ if(frame->win_number == EMPTY) --- src/window.c.orig Fri Dec 3 21:33:24 2004 +++ src/window.c Wed Jun 1 09:45:32 2005 @@ -566,6 +566,8 @@ set_active_window_body (rp_window *win, /* Call the switch window hook */ hook_run (&rp_switch_win_hook); + + raise_unmanaged (win->scr); } /* Go to the window, switching frames if the window is already in a