From e61ad3581fa4e640c32fb78408a17712a7155aa1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 3 Jun 2007 17:55:49 +0000 Subject: [PATCH] return if the window was restacked --- openbox/stacking.c | 19 +++++++++++++++---- openbox/stacking.h | 7 ++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/openbox/stacking.c b/openbox/stacking.c index 5d01e5e9..075f1386 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -551,9 +551,11 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) return occludes; } -void stacking_restack_request(ObClient *client, ObClient *sibling, - gint detail, gboolean activate) +gboolean stacking_restack_request(ObClient *client, ObClient *sibling, + gint detail, gboolean activate) { + gboolean ret = FALSE; + if (sibling && ((client->desktop != sibling->desktop && client->desktop != DESKTOP_ALL && sibling->desktop != DESKTOP_ALL) || @@ -570,6 +572,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, client->title, sibling ? sibling->title : "(all)"); /* just lower it */ stacking_lower(CLIENT_AS_WINDOW(client)); + ret = TRUE; break; case BottomIf: ob_debug("Restack request BottomIf for client %s sibling " @@ -577,8 +580,10 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, client->title, sibling ? sibling->title : "(all)"); /* if this client occludes sibling (or anything if NULL), then lower it to the bottom */ - if (stacking_occludes(client, sibling)) + if (stacking_occludes(client, sibling)) { stacking_lower(CLIENT_AS_WINDOW(client)); + ret = TRUE; + } break; case Above: ob_debug("Restack request Above for client %s sibling %s\n", @@ -589,6 +594,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, client_activate(client, FALSE, TRUE); else stacking_raise(CLIENT_AS_WINDOW(client)); + ret = TRUE; break; case TopIf: ob_debug("Restack request TopIf for client %s sibling %s\n", @@ -600,6 +606,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, client_activate(client, FALSE, TRUE); else stacking_raise(CLIENT_AS_WINDOW(client)); + ret = TRUE; } break; case Opposite: @@ -613,9 +620,13 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, client_activate(client, FALSE, TRUE); else stacking_raise(CLIENT_AS_WINDOW(client)); + ret = TRUE; } - else if (stacking_occludes(client, sibling)) + else if (stacking_occludes(client, sibling)) { stacking_lower(CLIENT_AS_WINDOW(client)); + ret = TRUE; + } break; } + return ret; } diff --git a/openbox/stacking.h b/openbox/stacking.h index eb638734..bf2f56b4 100644 --- a/openbox/stacking.h +++ b/openbox/stacking.h @@ -67,11 +67,12 @@ void stacking_below(ObWindow *window, ObWindow *below); @param detail One of Above, Below, TopIf, BottomIf, Opposite @param activate If TRUE, and if the window is going to be raised, it will be activated instead + @return TRUE if the client was restacked See http://tronche.com/gui/x/xlib/window/configure.html for details on how each detail works with and without a sibling. */ -void stacking_restack_request(struct _ObClient *client, - struct _ObClient *sibling, - gint detail, gboolean activate); +gboolean stacking_restack_request(struct _ObClient *client, + struct _ObClient *sibling, + gint detail, gboolean activate); #endif -- 2.45.2