<group> option for raise/lower related actions. hi floam.
This commit is contained in:
parent
e74fbdaa0e
commit
abe258be1d
7 changed files with 32 additions and 15 deletions
|
@ -5,6 +5,9 @@
|
|||
* 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:
|
||||
|
|
|
@ -906,6 +906,13 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
|
|||
} 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_raiselower(union ActionData *data)
|
|||
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_shadelower(union ActionData *data)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,6 +134,11 @@ struct CycleWindows {
|
|||
gboolean dialog;
|
||||
};
|
||||
|
||||
struct Stacking {
|
||||
struct AnyAction any;
|
||||
gboolean group;
|
||||
};
|
||||
|
||||
union ActionData {
|
||||
struct AnyAction any;
|
||||
struct InteractiveAction inter;
|
||||
|
@ -151,6 +156,7 @@ union ActionData {
|
|||
struct ShowMenu showmenu;
|
||||
struct CycleWindows cycle;
|
||||
struct Layer layer;
|
||||
struct Stacking stacking;
|
||||
};
|
||||
|
||||
struct _ObAction {
|
||||
|
|
|
@ -1147,9 +1147,9 @@ static void event_handle_dock(ObDock *s, XEvent *e)
|
|||
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);
|
||||
|
|
|
@ -204,7 +204,7 @@ void popup_show(ObPopup *self, gchar *text)
|
|||
|
||||
if (!self->mapped) {
|
||||
XMapWindow(ob_display, self->bg);
|
||||
stacking_raise(INTERNAL_AS_WINDOW(self));
|
||||
stacking_raise(INTERNAL_AS_WINDOW(self), FALSE);
|
||||
self->mapped = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ static GList *pick_windows(ObClient *top, ObClient *selected, gboolean raise)
|
|||
}
|
||||
|
||||
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 @@ static GList *pick_group_windows(ObClient *top, ObClient *selected,
|
|||
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 @@ static GList *pick_group_windows(ObClient *top, ObClient *selected,
|
|||
return ret;
|
||||
}
|
||||
|
||||
void stacking_raise(ObWindow *window)
|
||||
void stacking_raise(ObWindow *window, gboolean group)
|
||||
{
|
||||
GList *wins;
|
||||
|
||||
|
@ -281,7 +282,7 @@ void stacking_raise(ObWindow *window)
|
|||
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 @@ void stacking_raise(ObWindow *window)
|
|||
g_list_free(wins);
|
||||
}
|
||||
|
||||
void stacking_lower(ObWindow *window)
|
||||
void stacking_lower(ObWindow *window, gboolean group)
|
||||
{
|
||||
GList *wins;
|
||||
|
||||
|
@ -300,7 +301,7 @@ void stacking_lower(ObWindow *window)
|
|||
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 @@ void stacking_add(ObWindow *win)
|
|||
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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue