openbox/actions/kill.c \
openbox/actions/layer.c \
openbox/actions/lower.c \
+ openbox/actions/lowerraiseone.c \
openbox/actions/maximize.c \
openbox/actions/move.c \
openbox/actions/moverelative.c \
action_growtoedge_startup();
action_if_startup();
action_focustobottom_startup();
+ action_lowerraiseone_startup();
/* 3.4-compatibility */
action_shadelowerraise_startup();
}
void action_growtoedge_startup(void);
void action_if_startup(void);
void action_focustobottom_startup(void);
+void action_lowerraiseone_startup(void);
/* 3.4-compatibility */
void action_shadelowerraise_startup(void);
--- /dev/null
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+#include "openbox/window.h"
+#include "openbox/client.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+static gpointer setup_raise(xmlNodePtr node);
+static gpointer setup_lower(xmlNodePtr node);
+
+void action_lowerraiseone_startup(void)
+{
+ actions_register("RaiseOne",
+ setup_raise, NULL,
+ run_func);
+ actions_register("LowerOne",
+ setup_lower, NULL,
+ run_func);
+}
+
+static gpointer setup_raise(xmlNodePtr node)
+{
+ return GINT_TO_POINTER(1);
+}
+
+static gpointer setup_lower(xmlNodePtr node)
+{
+ return GINT_TO_POINTER(0);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ gint dir = GPOINTER_TO_INT(options) ? 1 : -1;
+
+ if (data->client) {
+ ObClient *client = data->client;
+ ObClient *sibling;
+ actions_client_move(data, TRUE);
+ if (dir == 1) {
+ sibling = stacking_occluded(client, NULL);
+ if (sibling)
+ stacking_above(client, sibling);
+ } else {
+ sibling = stacking_occludes(client, NULL);
+ if (sibling)
+ stacking_below(client, sibling);
+ }
+ actions_client_move(data, FALSE);
+ }
+
+ return FALSE;
+}
stacking_list_tail = g_list_last(stacking_list);
}
+void stacking_above(ObWindow *window, ObWindow *above)
+{
+ GList *wins, *before;
+
+ if (window_layer(window) != window_layer(above))
+ return;
+
+ wins = g_list_append(NULL, window);
+ stacking_list = g_list_remove(stacking_list, window);
+ before = g_list_previous(g_list_find(stacking_list, above));
+ do_restack(wins, before);
+ g_list_free(wins);
+}
+
void stacking_below(ObWindow *window, ObWindow *below)
{
GList *wins, *before;
stacking_list_tail = g_list_last(stacking_list);
}
-/*! Returns TRUE if client is occluded by the sibling. If sibling is NULL it
- tries against all other clients.
-*/
-static gboolean stacking_occluded(ObClient *client, ObClient *sibling)
+ObClient *stacking_occluded(ObClient *client, ObClient *sibling)
{
GList *it;
- gboolean occluded = FALSE;
+ ObClient *occluded = NULL;
/* no need for any looping in this case */
if (sibling && client->layer != sibling->layer)
{
if (sibling != NULL) {
if (c == sibling) {
- occluded = TRUE;
+ occluded = sibling;
break;
}
}
else if (c->layer == client->layer) {
- occluded = TRUE;
+ occluded = c;
break;
}
else if (c->layer > client->layer)
return occluded;
}
-/*! Returns TRUE if client occludes the sibling. If sibling is NULL it tries
- against all other clients.
-*/
-static gboolean stacking_occludes(ObClient *client, ObClient *sibling)
+ObClient *stacking_occludes(ObClient *client, ObClient *sibling)
{
GList *it;
- gboolean occludes = FALSE;
+ ObClient *occludes = NULL;
/* no need for any looping in this case */
if (sibling && client->layer != sibling->layer)
{
if (sibling != NULL) {
if (c == sibling) {
- occludes = TRUE;
+ occludes = sibling;
break;
}
}
else if (c->layer == client->layer) {
- occludes = TRUE;
+ occludes = c;
break;
}
else if (c->layer < client->layer)
it should really ONLY be used to restore stacking orders from saved sessions
*/
void stacking_below(struct _ObWindow *window, struct _ObWindow *below);
+/*! Ibid, above */
+void stacking_above(struct _ObWindow *window, struct _ObWindow *above);
+
+/*! Returns sibling if client is occluded by the sibling. If sibling is NULL it
+ tries against all other clients, then the nearest client occluding is returned.
+*/
+struct _ObClient *stacking_occluded(struct _ObClient *client, struct _ObClient *sibling);
+
+/*! Returns sibling if client occludes the sibling. If sibling is NULL it tries
+ against all other clients, then the nearest client occluded is returned.
+*/
+struct _ObClient *stacking_occludes(struct _ObClient *client, struct _ObClient *sibling);
/*! Restack a window based upon a sibling (or all windows) in various ways.
@param client The client to be restacked