#include "openbox/actions.h"
#include "openbox/stacking.h"
+#include "openbox/window.h"
static gboolean run_func(ObActionsData *data, gpointer options);
#include "openbox/actions.h"
#include "openbox/stacking.h"
+#include "openbox/window.h"
static gboolean run_func(ObActionsData *data, gpointer options);
#include "mwm.h"
#include "geom.h"
#include "stacking.h"
+#include "window.h"
#include "render/color.h"
#include <glib.h>
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;
#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 {
OB_STACKING_LAYER_INVALID,
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
return None;
}
-Window window_layer(ObWindow *self)
+ObStackingLayer window_layer(ObWindow *self)
{
switch (self->type) {
case Window_Menu:
#ifndef __window_h
#define __window_h
+#include "stacking.h"
+
#include <X11/Xlib.h>
#include <glib.h>
void window_shutdown(gboolean reconfig);
Window window_top(ObWindow *self);
-Window window_layer(ObWindow *self);
+ObStackingLayer window_layer(ObWindow *self);
#endif