]> Dogcows Code - chaz/openbox/commitdiff
make it possible to temporarily raise a window to the top, and restore it. also...
authorDana Jansens <danakj@orodu.net>
Fri, 11 Jan 2008 20:28:26 +0000 (15:28 -0500)
committerDana Jansens <danakj@orodu.net>
Fri, 11 Jan 2008 20:28:26 +0000 (15:28 -0500)
openbox/actions/lower.c
openbox/actions/raise.c
openbox/client.h
openbox/stacking.c
openbox/stacking.h
openbox/window.c
openbox/window.h

index 3a214ea7615fe10675a8996db43507abf3dbb14b..d34e933bc738a9e86203fb45d9fb26223421aa1e 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox/actions.h"
 #include "openbox/stacking.h"
+#include "openbox/window.h"
 
 static gboolean run_func(ObActionsData *data, gpointer options);
 
index 5dfe281a452458fbc9f2bbc1566ac5e8e16dd40a..6837bce2564916e2bc8bfe1550bfc9c1621296b7 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox/actions.h"
 #include "openbox/stacking.h"
+#include "openbox/window.h"
 
 static gboolean run_func(ObActionsData *data, gpointer options);
 
index b4b165f8035c68c61d2214b4c59fdceb387dc46d..e83a6b7a24c07d0cfdf36e31880e7d0c5b4a2851 100644 (file)
@@ -24,6 +24,7 @@
 #include "mwm.h"
 #include "geom.h"
 #include "stacking.h"
+#include "window.h"
 #include "render/color.h"
 
 #include <glib.h>
index b23e6eac1ca4f0f4b4a542e2b6fae49d073b84fd..bb8975d40f71efd7bc2abf8a8d3fa3bb5e8178ce 100644 (file)
@@ -105,6 +105,42 @@ static void do_restack(GList *wins, GList *before)
     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;
index ac9c8239cdc000fa2ec527df172968dcbc1277cf..e226f36f97572ded36fd86386b2cf3fe3c4ab2a4 100644 (file)
 #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,
@@ -44,21 +45,27 @@ extern GList *stacking_list;
   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
index 19b39c0912d4174650dcd3bcc12f5603cbed0caa..c5e6a4ea9c81eb63e89e1806b1ea690c5dc2cbe6 100644 (file)
@@ -63,7 +63,7 @@ Window window_top(ObWindow *self)
     return None;
 }
 
-Window window_layer(ObWindow *self)
+ObStackingLayer window_layer(ObWindow *self)
 {
     switch (self->type) {
     case Window_Menu:
index ef29edd7adc000d1852c2948298c04f903dac3f5..aaf83995806e4f8f56526a53a0d0c5c18d237941 100644 (file)
@@ -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
This page took 0.027228 seconds and 4 git commands to generate.