all repos — openbox @ abe258be1d7e7a6e9881a3e654d7e69994498c62

openbox fork - make it a bit more like ryudo

<group> option for raise/lower related actions. hi floam.
Mikael Magnusson mikachu@comhem.se
commit

abe258be1d7e7a6e9881a3e654d7e69994498c62

parent

e74fbdaa0e8ee61b747b4efb4f66ae3992af925c

M CHANGELOGCHANGELOG

@@ -5,6 +5,9 @@ * Fixed directional focus not getting trapped in omnipresent windows

* Fixed focus actions when bound to the mouse, normal focus cycle is always linear and directional focus is totally disabled, it makes no sense anyway, just move the mouse. + * Added an option for the raise/lower/raiselower/unshaderaise/shadelower + options called group that lets you bind stuff to raise/lower the whole + window group. <action name="raise"><group>yes</group></action> * Various bug fixes. (I always wanted to write this in a changelog) 3.2:
M openbox/action.copenbox/action.c

@@ -906,6 +906,13 @@ act->data.cycle.dialog = parse_bool(doc, n);

} else if (act->func == action_directional_focus) { if ((n = parse_find_node("dialog", node->xmlChildrenNode))) act->data.cycle.dialog = parse_bool(doc, n); + } else if (act->func == action_raise || + act->func == action_lower || + act->func == action_raiselower || + act->func == action_shadelower || + act->func == action_unshaderaise) { + if ((n = parse_find_node("group", node->xmlChildrenNode))) + act->data.stacking.group = parse_bool(doc, n); } INTERACTIVE_LIMIT(act, uact); }

@@ -1076,7 +1083,7 @@

void action_raise(union ActionData *data) { client_action_start(data); - stacking_raise(CLIENT_AS_WINDOW(data->client.any.c)); + stacking_raise(CLIENT_AS_WINDOW(data->client.any.c), data->stacking.group); client_action_end(data); }

@@ -1099,7 +1106,7 @@

void action_lower(union ActionData *data) { client_action_start(data); - stacking_lower(CLIENT_AS_WINDOW(data->client.any.c)); + stacking_lower(CLIENT_AS_WINDOW(data->client.any.c), data->stacking.group); client_action_end(data); }
M openbox/action.hopenbox/action.h

@@ -134,6 +134,11 @@ gboolean forward;

gboolean dialog; }; +struct Stacking { + struct AnyAction any; + gboolean group; +}; + union ActionData { struct AnyAction any; struct InteractiveAction inter;

@@ -151,6 +156,7 @@ struct MoveResize moveresize;

struct ShowMenu showmenu; struct CycleWindows cycle; struct Layer layer; + struct Stacking stacking; }; struct _ObAction {
M openbox/event.copenbox/event.c

@@ -1147,9 +1147,9 @@ {

switch (e->type) { case ButtonPress: if (e->xbutton.button == 1) - stacking_raise(DOCK_AS_WINDOW(s)); + stacking_raise(DOCK_AS_WINDOW(s), FALSE); else if (e->xbutton.button == 2) - stacking_lower(DOCK_AS_WINDOW(s)); + stacking_lower(DOCK_AS_WINDOW(s), FALSE); break; case EnterNotify: dock_hide(FALSE);
M openbox/popup.copenbox/popup.c

@@ -204,7 +204,7 @@ }

if (!self->mapped) { XMapWindow(ob_display, self->bg); - stacking_raise(INTERNAL_AS_WINDOW(self)); + stacking_raise(INTERNAL_AS_WINDOW(self), FALSE); self->mapped = TRUE; } }
M openbox/stacking.copenbox/stacking.c

@@ -229,7 +229,7 @@ return ret;

} static GList *pick_group_windows(ObClient *top, ObClient *selected, - gboolean raise) + gboolean raise, gboolean normal) { GList *ret = NULL; GList *it, *next, *prev;

@@ -256,7 +256,8 @@ if ((c->desktop == selected->desktop ||

c->desktop == DESKTOP_ALL) && (t == OB_CLIENT_TYPE_TOOLBAR || t == OB_CLIENT_TYPE_MENU || - t == OB_CLIENT_TYPE_UTILITY)) + t == OB_CLIENT_TYPE_UTILITY || + (normal && t == OB_CLIENT_TYPE_NORMAL))) { ret = g_list_concat(ret, pick_windows(sit->data,

@@ -271,7 +272,7 @@ }

return ret; } -void stacking_raise(ObWindow *window) +void stacking_raise(ObWindow *window, gboolean group) { GList *wins;

@@ -281,7 +282,7 @@ ObClient *selected;

selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, TRUE); - wins = g_list_concat(wins, pick_group_windows(c, selected, TRUE)); + wins = g_list_concat(wins, pick_group_windows(c, selected, TRUE, group)); } else { wins = g_list_append(NULL, window); stacking_list = g_list_remove(stacking_list, window);

@@ -290,7 +291,7 @@ do_raise(wins);

g_list_free(wins); } -void stacking_lower(ObWindow *window) +void stacking_lower(ObWindow *window, gboolean group) { GList *wins;

@@ -300,7 +301,7 @@ ObClient *selected;

selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, FALSE); - wins = g_list_concat(pick_group_windows(c, selected, FALSE), wins); + wins = g_list_concat(pick_group_windows(c, selected, FALSE, group), wins); } else { wins = g_list_append(NULL, window); stacking_list = g_list_remove(stacking_list, window);

@@ -329,13 +330,13 @@ ObStackingLayer l;

GList *wins; g_assert(screen_support_win != None); /* make sure I dont break this in the - future */ + future */ l = window_layer(win); wins = g_list_append(NULL, win); /* list of 1 element */ stacking_list = g_list_append(stacking_list, win); - stacking_raise(win); + stacking_raise(win, FALSE); } void stacking_add_nonintrusive(ObWindow *win)
M openbox/stacking.hopenbox/stacking.h

@@ -47,10 +47,10 @@ void stacking_add_nonintrusive(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(ObWindow *window, gboolean group); /*! Lowers a window below all others in its stacking layer */ -void stacking_lower(ObWindow *window); +void stacking_lower(ObWindow *window, gboolean group); /*! Moves a window below another if its in the same layer. This function does not enforce stacking rules IRT transients n such, and so