all repos — openbox @ abc67cbdc1c1e61e074f8f312eaecb357cd0aa5c

openbox fork - make it a bit more like ryudo

make it possible to temporarily raise a window to the top, and restore it.  also fix the return val for window_layer.
Dana Jansens danakj@orodu.net
commit

abc67cbdc1c1e61e074f8f312eaecb357cd0aa5c

parent

1789d4564514c4cefe3d2e9d2b7b65119784b53c

M openbox/actions/lower.copenbox/actions/lower.c

@@ -1,5 +1,6 @@

#include "openbox/actions.h" #include "openbox/stacking.h" +#include "openbox/window.h" static gboolean run_func(ObActionsData *data, gpointer options);
M openbox/actions/raise.copenbox/actions/raise.c

@@ -1,5 +1,6 @@

#include "openbox/actions.h" #include "openbox/stacking.h" +#include "openbox/window.h" static gboolean run_func(ObActionsData *data, gpointer options);
M openbox/client.hopenbox/client.h

@@ -24,6 +24,7 @@ #include "misc.h"

#include "mwm.h" #include "geom.h" #include "stacking.h" +#include "window.h" #include "render/color.h" #include <glib.h>
M openbox/stacking.copenbox/stacking.c

@@ -105,6 +105,42 @@

stacking_set_list(); } +void stacking_temp_raise(ObWindow *window) +{ + Window win[2]; + GList *it; + + /* don't use this for internal windows..! it would lower them.. */ + g_assert(window_layer(window) < OB_STACKING_LAYER_INTERNAL); + + /* find the window to drop it underneath */ + win[0] = screen_support_win; + for (it = stacking_list; it; it = g_list_next(it)) { + ObWindow *w = it->data; + if (window_layer(w) >= OB_STACKING_LAYER_INTERNAL) + win[0] = window_top(w); + else + break; + } + + win[1] = window_top(window); + XRestackWindows(ob_display, win, 2); +} + +void stacking_restore() +{ + Window *win; + GList *it; + gint i; + + win = g_new(Window, g_list_length(stacking_list) + 1); + win[0] = screen_support_win; + for (i = 1, it = stacking_list; it; ++i, it = g_list_next(it)) + win[i] = window_top(it->data); + XRestackWindows(ob_display, win, i); + g_free(win); +} + static void do_raise(GList *wins) { GList *it;
M openbox/stacking.hopenbox/stacking.h

@@ -20,10 +20,11 @@

#ifndef __stacking_h #define __stacking_h -#include "window.h" - #include <glib.h> #include <X11/Xlib.h> + +struct _ObWindow; +struct _ObClient; /*! The possible stacking layers a client window can be a part of */ typedef enum {

@@ -44,21 +45,27 @@ /*! Sets the window stacking list on the root window from the

stacking_list */ void stacking_set_list(); -void stacking_add(ObWindow *win); -void stacking_add_nonintrusive(ObWindow *win); +void stacking_add(struct _ObWindow *win); +void stacking_add_nonintrusive(struct _ObWindow *win); #define stacking_remove(win) stacking_list = g_list_remove(stacking_list, win); /*! Raises a window above all others in its stacking layer */ -void stacking_raise(ObWindow *window); +void stacking_raise(struct _ObWindow *window); + +/*! Temporarily raises a window above all others */ +void stacking_temp_raise(struct _ObWindow *window); + +/*! Restores any temporarily raised windows to their correct place */ +void stacking_restore(); /*! Lowers a window below all others in its stacking layer */ -void stacking_lower(ObWindow *window); +void stacking_lower(struct _ObWindow *window); /*! Moves a window below another if its in the same layer. This function does not enforce stacking rules IRT transients n such, and so it should really ONLY be used to restore stacking orders from saved sessions */ -void stacking_below(ObWindow *window, ObWindow *below); +void stacking_below(struct _ObWindow *window, struct _ObWindow *below); /*! Restack a window based upon a sibling (or all windows) in various ways. @param client The client to be restacked
M openbox/window.copenbox/window.c

@@ -63,7 +63,7 @@ g_assert_not_reached();

return None; } -Window window_layer(ObWindow *self) +ObStackingLayer window_layer(ObWindow *self) { switch (self->type) { case Window_Menu:
M openbox/window.hopenbox/window.h

@@ -19,6 +19,8 @@

#ifndef __window_h #define __window_h +#include "stacking.h" + #include <X11/Xlib.h> #include <glib.h>

@@ -74,6 +76,6 @@ void window_startup(gboolean reconfig);

void window_shutdown(gboolean reconfig); Window window_top(ObWindow *self); -Window window_layer(ObWindow *self); +ObStackingLayer window_layer(ObWindow *self); #endif