summaryrefslogtreecommitdiff
path: root/openbox/stacking.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-10 04:06:50 +0000
committerDana Jansens <danakj@orodu.net>2007-05-10 04:06:50 +0000
commitc2c84c3f5ed75561d7d6502f787ab06bc7d984d2 (patch)
tree458bacc4398654f6f395bbb2de8e6a788644b050 /openbox/stacking.c
parentae4bb6bcb25e3e8b2405b38baebc1859b8135454 (diff)
add support for _NET_RESTACK_WINDOW
Diffstat (limited to 'openbox/stacking.c')
-rw-r--r--openbox/stacking.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/openbox/stacking.c b/openbox/stacking.c
index afad8ad0..70a072fc 100644
--- a/openbox/stacking.c
+++ b/openbox/stacking.c
@@ -25,6 +25,7 @@
#include "group.h"
#include "frame.h"
#include "window.h"
+#include "debug.h"
GList *stacking_list = NULL;
@@ -492,3 +493,46 @@ gboolean stacking_occluded(ObClient *client, ObClient *sibling)
}
return obscured;
}
+
+void stacking_restack_request(ObClient *client, ObClient *sibling,
+ gint detail)
+{
+ switch (detail) {
+ case Below:
+ ob_debug("Restack request Below for client %s sibling %s\n",
+ client->title, sibling ? sibling->title : "(all)");
+ /* just lower it */
+ stacking_lower(CLIENT_AS_WINDOW(client));
+ break;
+ case BottomIf:
+ ob_debug("Restack request BottomIf for client %s sibling "
+ "%s\n",
+ client->title, sibling ? sibling->title : "(all)");
+ /* if this client occludes sibling (or anything if NULL), then
+ lower it to the bottom */
+ if (stacking_occluded(sibling, client))
+ stacking_lower(CLIENT_AS_WINDOW(client));
+ break;
+ case Above:
+ ob_debug("Restack request Above for client %s sibling %s\n",
+ client->title, sibling ? sibling->title : "(all)");
+ /* activate it rather than just focus it */
+ client_activate(client, FALSE, FALSE);
+ break;
+ case TopIf:
+ ob_debug("Restack request TopIf for client %s sibling %s\n",
+ client->title, sibling ? sibling->title : "(all)");
+ if (stacking_occluded(client, sibling))
+ /* activate it rather than just focus it */
+ client_activate(client, FALSE, FALSE);
+ case Opposite:
+ ob_debug("Restack request Opposite for client %s sibling "
+ "%s\n",
+ client->title, sibling ? sibling->title : "(all)");
+ if (stacking_occluded(client, sibling))
+ /* activate it rather than just focus it */
+ client_activate(client, FALSE, FALSE);
+ else if (stacking_occluded(sibling, client))
+ stacking_lower(CLIENT_AS_WINDOW(client));
+ }
+}