add the ObClientActionReq to ObAction which says if an action needs a client for it or not
This commit is contained in:
parent
84dfd803d0
commit
1213b079bb
2 changed files with 187 additions and 209 deletions
386
openbox/action.c
386
openbox/action.c
|
@ -137,11 +137,13 @@ void setup_action_directional_focus_northwest(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendto.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendto.follow = TRUE;
|
(*a)->data.sendto.follow = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_send_to_desktop_prev(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_prev(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_WEST;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_WEST;
|
||||||
(*a)->data.sendtodir.linear = TRUE;
|
(*a)->data.sendtodir.linear = TRUE;
|
||||||
|
@ -151,6 +153,7 @@ void setup_action_send_to_desktop_prev(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop_next(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_next(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_EAST;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_EAST;
|
||||||
(*a)->data.sendtodir.linear = TRUE;
|
(*a)->data.sendtodir.linear = TRUE;
|
||||||
|
@ -160,6 +163,7 @@ void setup_action_send_to_desktop_next(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop_left(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_left(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_WEST;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_WEST;
|
||||||
(*a)->data.sendtodir.linear = FALSE;
|
(*a)->data.sendtodir.linear = FALSE;
|
||||||
|
@ -169,6 +173,7 @@ void setup_action_send_to_desktop_left(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop_right(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_right(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_EAST;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_EAST;
|
||||||
(*a)->data.sendtodir.linear = FALSE;
|
(*a)->data.sendtodir.linear = FALSE;
|
||||||
|
@ -178,6 +183,7 @@ void setup_action_send_to_desktop_right(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop_up(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_up(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_NORTH;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_NORTH;
|
||||||
(*a)->data.sendtodir.linear = FALSE;
|
(*a)->data.sendtodir.linear = FALSE;
|
||||||
|
@ -187,6 +193,7 @@ void setup_action_send_to_desktop_up(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_send_to_desktop_down(ObAction **a, ObUserAction uact)
|
void setup_action_send_to_desktop_down(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.sendtodir.inter.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
(*a)->data.sendtodir.inter.any.interactive = TRUE;
|
||||||
(*a)->data.sendtodir.dir = OB_DIRECTION_SOUTH;
|
(*a)->data.sendtodir.dir = OB_DIRECTION_SOUTH;
|
||||||
(*a)->data.sendtodir.linear = FALSE;
|
(*a)->data.sendtodir.linear = FALSE;
|
||||||
|
@ -258,61 +265,73 @@ void setup_action_cycle_windows_previous(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_movetoedge_north(ObAction **a, ObUserAction uact)
|
void setup_action_movetoedge_north(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_NORTH;
|
(*a)->data.diraction.direction = OB_DIRECTION_NORTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_movetoedge_south(ObAction **a, ObUserAction uact)
|
void setup_action_movetoedge_south(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_SOUTH;
|
(*a)->data.diraction.direction = OB_DIRECTION_SOUTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_movetoedge_east(ObAction **a, ObUserAction uact)
|
void setup_action_movetoedge_east(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_EAST;
|
(*a)->data.diraction.direction = OB_DIRECTION_EAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_movetoedge_west(ObAction **a, ObUserAction uact)
|
void setup_action_movetoedge_west(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_WEST;
|
(*a)->data.diraction.direction = OB_DIRECTION_WEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_growtoedge_north(ObAction **a, ObUserAction uact)
|
void setup_action_growtoedge_north(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_NORTH;
|
(*a)->data.diraction.direction = OB_DIRECTION_NORTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_growtoedge_south(ObAction **a, ObUserAction uact)
|
void setup_action_growtoedge_south(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_SOUTH;
|
(*a)->data.diraction.direction = OB_DIRECTION_SOUTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_growtoedge_east(ObAction **a, ObUserAction uact)
|
void setup_action_growtoedge_east(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_EAST;
|
(*a)->data.diraction.direction = OB_DIRECTION_EAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_growtoedge_west(ObAction **a, ObUserAction uact)
|
void setup_action_growtoedge_west(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.diraction.direction = OB_DIRECTION_WEST;
|
(*a)->data.diraction.direction = OB_DIRECTION_WEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_top_layer(ObAction **a, ObUserAction uact)
|
void setup_action_top_layer(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.layer.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.layer.layer = 1;
|
(*a)->data.layer.layer = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_normal_layer(ObAction **a, ObUserAction uact)
|
void setup_action_normal_layer(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.layer.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.layer.layer = 0;
|
(*a)->data.layer.layer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_bottom_layer(ObAction **a, ObUserAction uact)
|
void setup_action_bottom_layer(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.layer.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.layer.layer = -1;
|
(*a)->data.layer.layer = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_action_move(ObAction **a, ObUserAction uact)
|
void setup_action_move(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.moveresize.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.moveresize.move = TRUE;
|
(*a)->data.moveresize.move = TRUE;
|
||||||
(*a)->data.moveresize.keyboard =
|
(*a)->data.moveresize.keyboard =
|
||||||
(uact == OB_USER_ACTION_KEYBOARD_KEY ||
|
(uact == OB_USER_ACTION_KEYBOARD_KEY ||
|
||||||
|
@ -321,6 +340,7 @@ void setup_action_move(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_resize(ObAction **a, ObUserAction uact)
|
void setup_action_resize(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.moveresize.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
(*a)->data.moveresize.move = FALSE;
|
(*a)->data.moveresize.move = FALSE;
|
||||||
(*a)->data.moveresize.keyboard =
|
(*a)->data.moveresize.keyboard =
|
||||||
(uact == OB_USER_ACTION_KEYBOARD_KEY ||
|
(uact == OB_USER_ACTION_KEYBOARD_KEY ||
|
||||||
|
@ -329,6 +349,7 @@ void setup_action_resize(ObAction **a, ObUserAction uact)
|
||||||
|
|
||||||
void setup_action_showmenu(ObAction **a, ObUserAction uact)
|
void setup_action_showmenu(ObAction **a, ObUserAction uact)
|
||||||
{
|
{
|
||||||
|
(*a)->data.showmenu.any.client_action = OB_CLIENT_ACTION_OPTIONAL;
|
||||||
/* you cannot call ShowMenu from inside a menu, cuz the menu code makes
|
/* you cannot call ShowMenu from inside a menu, cuz the menu code makes
|
||||||
assumptions that there is only one menu (and submenus) open at
|
assumptions that there is only one menu (and submenus) open at
|
||||||
a time! */
|
a time! */
|
||||||
|
@ -338,6 +359,11 @@ void setup_action_showmenu(ObAction **a, ObUserAction uact)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setup_client_action(ObAction **a, ObUserAction uact)
|
||||||
|
{
|
||||||
|
(*a)->data.any.client_action = OB_CLIENT_ACTION_ALWAYS;
|
||||||
|
}
|
||||||
|
|
||||||
ActionString actionstrings[] =
|
ActionString actionstrings[] =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -388,142 +414,142 @@ ActionString actionstrings[] =
|
||||||
{
|
{
|
||||||
"activate",
|
"activate",
|
||||||
action_activate,
|
action_activate,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"focus",
|
"focus",
|
||||||
action_focus,
|
action_focus,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unfocus",
|
"unfocus",
|
||||||
action_unfocus,
|
action_unfocus,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"iconify",
|
"iconify",
|
||||||
action_iconify,
|
action_iconify,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"raiselower",
|
"raiselower",
|
||||||
action_raiselower,
|
action_raiselower,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"raise",
|
"raise",
|
||||||
action_raise,
|
action_raise,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"lower",
|
"lower",
|
||||||
action_lower,
|
action_lower,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"close",
|
"close",
|
||||||
action_close,
|
action_close,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kill",
|
"kill",
|
||||||
action_kill,
|
action_kill,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"shadelower",
|
"shadelower",
|
||||||
action_shadelower,
|
action_shadelower,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unshaderaise",
|
"unshaderaise",
|
||||||
action_unshaderaise,
|
action_unshaderaise,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"shade",
|
"shade",
|
||||||
action_shade,
|
action_shade,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unshade",
|
"unshade",
|
||||||
action_unshade,
|
action_unshade,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"toggleshade",
|
"toggleshade",
|
||||||
action_toggle_shade,
|
action_toggle_shade,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"toggleomnipresent",
|
"toggleomnipresent",
|
||||||
action_toggle_omnipresent,
|
action_toggle_omnipresent,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moverelativehorz",
|
"moverelativehorz",
|
||||||
action_move_relative_horz,
|
action_move_relative_horz,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moverelativevert",
|
"moverelativevert",
|
||||||
action_move_relative_vert,
|
action_move_relative_vert,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resizerelativehorz",
|
"resizerelativehorz",
|
||||||
action_resize_relative_horz,
|
action_resize_relative_horz,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"resizerelativevert",
|
"resizerelativevert",
|
||||||
action_resize_relative_vert,
|
action_resize_relative_vert,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"maximizefull",
|
"maximizefull",
|
||||||
action_maximize_full,
|
action_maximize_full,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unmaximizefull",
|
"unmaximizefull",
|
||||||
action_unmaximize_full,
|
action_unmaximize_full,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"togglemaximizefull",
|
"togglemaximizefull",
|
||||||
action_toggle_maximize_full,
|
action_toggle_maximize_full,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"maximizehorz",
|
"maximizehorz",
|
||||||
action_maximize_horz,
|
action_maximize_horz,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unmaximizehorz",
|
"unmaximizehorz",
|
||||||
action_unmaximize_horz,
|
action_unmaximize_horz,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"togglemaximizehorz",
|
"togglemaximizehorz",
|
||||||
action_toggle_maximize_horz,
|
action_toggle_maximize_horz,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"maximizevert",
|
"maximizevert",
|
||||||
action_maximize_vert,
|
action_maximize_vert,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unmaximizevert",
|
"unmaximizevert",
|
||||||
action_unmaximize_vert,
|
action_unmaximize_vert,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"togglemaximizevert",
|
"togglemaximizevert",
|
||||||
action_toggle_maximize_vert,
|
action_toggle_maximize_vert,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sendtodesktop",
|
"sendtodesktop",
|
||||||
|
@ -598,7 +624,7 @@ ActionString actionstrings[] =
|
||||||
{
|
{
|
||||||
"toggledecorations",
|
"toggledecorations",
|
||||||
action_toggle_decorations,
|
action_toggle_decorations,
|
||||||
NULL
|
setup_client_action
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"move",
|
"move",
|
||||||
|
@ -848,21 +874,23 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
|
||||||
for (it = acts; it; it = g_slist_next(it)) {
|
for (it = acts; it; it = g_slist_next(it)) {
|
||||||
a = it->data;
|
a = it->data;
|
||||||
|
|
||||||
a->data.any.c = c;
|
if (!(a->data.any.client_action == OB_CLIENT_ACTION_ALWAYS && !c)) {
|
||||||
a->data.any.context = context;
|
a->data.any.c = a->data.any.client_action ? c : NULL;
|
||||||
a->data.any.x = x;
|
a->data.any.context = context;
|
||||||
a->data.any.y = y;
|
a->data.any.x = x;
|
||||||
|
a->data.any.y = y;
|
||||||
|
|
||||||
a->data.any.button = button;
|
a->data.any.button = button;
|
||||||
|
|
||||||
if (a->data.any.interactive) {
|
if (a->data.any.interactive) {
|
||||||
a->data.inter.cancel = cancel;
|
a->data.inter.cancel = cancel;
|
||||||
a->data.inter.final = done;
|
a->data.inter.final = done;
|
||||||
if (!(cancel || done))
|
if (!(cancel || done))
|
||||||
keyboard_interactive_grab(state, c, a);
|
keyboard_interactive_grab(state, a->data.any.c, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
a->func(&a->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
a->func(&a->data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -886,26 +914,22 @@ void action_execute(union ActionData *data)
|
||||||
|
|
||||||
void action_activate(union ActionData *data)
|
void action_activate(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->activate.any.c)
|
client_activate(data->activate.any.c, data->activate.here);
|
||||||
client_activate(data->activate.any.c, data->activate.here);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_focus(union ActionData *data)
|
void action_focus(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c)
|
client_focus(data->client.any.c);
|
||||||
client_focus(data->client.any.c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_unfocus (union ActionData *data)
|
void action_unfocus (union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c)
|
client_unfocus(data->client.any.c);
|
||||||
client_unfocus(data->client.any.c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_iconify(union ActionData *data)
|
void action_iconify(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c)
|
client_iconify(data->client.any.c, TRUE, TRUE);
|
||||||
client_iconify(data->client.any.c, TRUE, TRUE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_raiselower(union ActionData *data)
|
void action_raiselower(union ActionData *data)
|
||||||
|
@ -914,8 +938,6 @@ void action_raiselower(union ActionData *data)
|
||||||
GList *it;
|
GList *it;
|
||||||
gboolean raise = FALSE;
|
gboolean raise = FALSE;
|
||||||
|
|
||||||
if (!c) return;
|
|
||||||
|
|
||||||
for (it = stacking_list; it; it = g_list_next(it)) {
|
for (it = stacking_list; it; it = g_list_next(it)) {
|
||||||
ObClient *cit = it->data;
|
ObClient *cit = it->data;
|
||||||
|
|
||||||
|
@ -944,133 +966,110 @@ void action_raiselower(union ActionData *data)
|
||||||
|
|
||||||
void action_raise(union ActionData *data)
|
void action_raise(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
|
stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
|
||||||
|
client_action_end(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void action_unshaderaise(union ActionData *data)
|
||||||
|
{
|
||||||
|
if (data->client.any.c->shaded) {
|
||||||
|
client_action_start(data);
|
||||||
|
client_shade(data->client.any.c, FALSE);
|
||||||
|
client_action_end(data);
|
||||||
|
} else {
|
||||||
client_action_start(data);
|
client_action_start(data);
|
||||||
stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
|
stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
|
||||||
client_action_end(data);
|
client_action_end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_unshaderaise(union ActionData *data)
|
|
||||||
{
|
|
||||||
if (data->client.any.c) {
|
|
||||||
if (data->client.any.c->shaded) {
|
|
||||||
client_action_start(data);
|
|
||||||
client_shade(data->client.any.c, FALSE);
|
|
||||||
client_action_end(data);
|
|
||||||
} else {
|
|
||||||
client_action_start(data);
|
|
||||||
stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
|
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void action_shadelower(union ActionData *data)
|
void action_shadelower(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
if (data->client.any.c->shaded)
|
||||||
if (data->client.any.c->shaded)
|
|
||||||
stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
|
|
||||||
else {
|
|
||||||
client_action_start(data);
|
|
||||||
client_shade(data->client.any.c, TRUE);
|
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void action_lower(union ActionData *data)
|
|
||||||
{
|
|
||||||
if (data->client.any.c) {
|
|
||||||
client_action_start(data);
|
|
||||||
stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
|
stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
|
||||||
client_action_end(data);
|
else {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void action_close(union ActionData *data)
|
|
||||||
{
|
|
||||||
if (data->client.any.c)
|
|
||||||
client_close(data->client.any.c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void action_kill(union ActionData *data)
|
|
||||||
{
|
|
||||||
if (data->client.any.c)
|
|
||||||
client_kill(data->client.any.c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void action_shade(union ActionData *data)
|
|
||||||
{
|
|
||||||
if (data->client.any.c) {
|
|
||||||
client_action_start(data);
|
client_action_start(data);
|
||||||
client_shade(data->client.any.c, TRUE);
|
client_shade(data->client.any.c, TRUE);
|
||||||
client_action_end(data);
|
client_action_end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void action_lower(union ActionData *data)
|
||||||
|
{
|
||||||
|
client_action_start(data);
|
||||||
|
stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
|
||||||
|
client_action_end(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void action_close(union ActionData *data)
|
||||||
|
{
|
||||||
|
client_close(data->client.any.c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void action_kill(union ActionData *data)
|
||||||
|
{
|
||||||
|
client_kill(data->client.any.c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void action_shade(union ActionData *data)
|
||||||
|
{
|
||||||
|
client_action_start(data);
|
||||||
|
client_shade(data->client.any.c, TRUE);
|
||||||
|
client_action_end(data);
|
||||||
|
}
|
||||||
|
|
||||||
void action_unshade(union ActionData *data)
|
void action_unshade(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_shade(data->client.any.c, FALSE);
|
||||||
client_shade(data->client.any.c, FALSE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_shade(union ActionData *data)
|
void action_toggle_shade(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_shade(data->client.any.c, !data->client.any.c->shaded);
|
||||||
client_shade(data->client.any.c, !data->client.any.c->shaded);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_omnipresent(union ActionData *data)
|
void action_toggle_omnipresent(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c)
|
client_set_desktop(data->client.any.c,
|
||||||
client_set_desktop(data->client.any.c,
|
data->client.any.c->desktop == DESKTOP_ALL ?
|
||||||
data->client.any.c->desktop == DESKTOP_ALL ?
|
screen_desktop : DESKTOP_ALL, FALSE);
|
||||||
screen_desktop : DESKTOP_ALL, FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_move_relative_horz(union ActionData *data)
|
void action_move_relative_horz(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->relative.any.c;
|
ObClient *c = data->relative.any.c;
|
||||||
if (c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_move(c, c->area.x + data->relative.delta, c->area.y);
|
||||||
client_move(c, c->area.x + data->relative.delta, c->area.y);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_move_relative_vert(union ActionData *data)
|
void action_move_relative_vert(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->relative.any.c;
|
ObClient *c = data->relative.any.c;
|
||||||
if (c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_move(c, c->area.x, c->area.y + data->relative.delta);
|
||||||
client_move(c, c->area.x, c->area.y + data->relative.delta);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_resize_relative_horz(union ActionData *data)
|
void action_resize_relative_horz(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->relative.any.c;
|
ObClient *c = data->relative.any.c;
|
||||||
if (c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_resize(c,
|
||||||
client_resize(c,
|
c->area.width + data->relative.delta * c->size_inc.width,
|
||||||
c->area.width + data->relative.delta * c->size_inc.width,
|
c->area.height);
|
||||||
c->area.height);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_resize_relative_vert(union ActionData *data)
|
void action_resize_relative_vert(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->relative.any.c;
|
ObClient *c = data->relative.any.c;
|
||||||
if (c && !c->shaded) {
|
if (!c->shaded) {
|
||||||
client_action_start(data);
|
client_action_start(data);
|
||||||
client_resize(c, c->area.width, c->area.height +
|
client_resize(c, c->area.width, c->area.height +
|
||||||
data->relative.delta * c->size_inc.height);
|
data->relative.delta * c->size_inc.height);
|
||||||
|
@ -1080,95 +1079,77 @@ void action_resize_relative_vert(union ActionData *data)
|
||||||
|
|
||||||
void action_maximize_full(union ActionData *data)
|
void action_maximize_full(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, TRUE, 0, TRUE);
|
||||||
client_maximize(data->client.any.c, TRUE, 0, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_unmaximize_full(union ActionData *data)
|
void action_unmaximize_full(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, FALSE, 0, TRUE);
|
||||||
client_maximize(data->client.any.c, FALSE, 0, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_maximize_full(union ActionData *data)
|
void action_toggle_maximize_full(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c,
|
||||||
client_maximize(data->client.any.c,
|
!(data->client.any.c->max_horz ||
|
||||||
!(data->client.any.c->max_horz ||
|
data->client.any.c->max_vert),
|
||||||
data->client.any.c->max_vert),
|
0, TRUE);
|
||||||
0, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_maximize_horz(union ActionData *data)
|
void action_maximize_horz(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, TRUE, 1, TRUE);
|
||||||
client_maximize(data->client.any.c, TRUE, 1, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_unmaximize_horz(union ActionData *data)
|
void action_unmaximize_horz(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, FALSE, 1, TRUE);
|
||||||
client_maximize(data->client.any.c, FALSE, 1, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_maximize_horz(union ActionData *data)
|
void action_toggle_maximize_horz(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c,
|
||||||
client_maximize(data->client.any.c,
|
!data->client.any.c->max_horz, 1, TRUE);
|
||||||
!data->client.any.c->max_horz, 1, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_maximize_vert(union ActionData *data)
|
void action_maximize_vert(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, TRUE, 2, TRUE);
|
||||||
client_maximize(data->client.any.c, TRUE, 2, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_unmaximize_vert(union ActionData *data)
|
void action_unmaximize_vert(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c, FALSE, 2, TRUE);
|
||||||
client_maximize(data->client.any.c, FALSE, 2, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_maximize_vert(union ActionData *data)
|
void action_toggle_maximize_vert(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->client.any.c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
client_maximize(data->client.any.c,
|
||||||
client_maximize(data->client.any.c,
|
!data->client.any.c->max_vert, 2, TRUE);
|
||||||
!data->client.any.c->max_vert, 2, TRUE);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_send_to_desktop(union ActionData *data)
|
void action_send_to_desktop(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->sendto.any.c;
|
ObClient *c = data->sendto.any.c;
|
||||||
|
|
||||||
if (!c || !client_normal(c)) return;
|
if (!client_normal(c)) return;
|
||||||
|
|
||||||
if (data->sendto.desk < screen_num_desktops ||
|
if (data->sendto.desk < screen_num_desktops ||
|
||||||
data->sendto.desk == DESKTOP_ALL) {
|
data->sendto.desk == DESKTOP_ALL) {
|
||||||
|
@ -1207,7 +1188,7 @@ void action_send_to_desktop_dir(union ActionData *data)
|
||||||
ObClient *c = data->sendtodir.inter.any.c;
|
ObClient *c = data->sendtodir.inter.any.c;
|
||||||
guint d;
|
guint d;
|
||||||
|
|
||||||
if (!c || !client_normal(c)) return;
|
if (!client_normal(c)) return;
|
||||||
|
|
||||||
d = screen_cycle_desktop(data->sendtodir.dir, data->sendtodir.wrap,
|
d = screen_cycle_desktop(data->sendtodir.dir, data->sendtodir.wrap,
|
||||||
data->sendtodir.linear,
|
data->sendtodir.linear,
|
||||||
|
@ -1232,12 +1213,10 @@ void action_toggle_decorations(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->client.any.c;
|
ObClient *c = data->client.any.c;
|
||||||
|
|
||||||
if (c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
c->decorate = !c->decorate;
|
||||||
c->decorate = !c->decorate;
|
client_setup_decor_and_functions(c);
|
||||||
client_setup_decor_and_functions(c);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint32 pick_corner(int x, int y, int cx, int cy, int cw, int ch)
|
static guint32 pick_corner(int x, int y, int cx, int cy, int cw, int ch)
|
||||||
|
@ -1260,7 +1239,7 @@ void action_moveresize(union ActionData *data)
|
||||||
ObClient *c = data->moveresize.any.c;
|
ObClient *c = data->moveresize.any.c;
|
||||||
guint32 corner;
|
guint32 corner;
|
||||||
|
|
||||||
if (!c || !client_normal(c)) return;
|
if (!client_normal(c)) return;
|
||||||
|
|
||||||
if (data->moveresize.keyboard) {
|
if (data->moveresize.keyboard) {
|
||||||
corner = (data->moveresize.move ?
|
corner = (data->moveresize.move ?
|
||||||
|
@ -1327,8 +1306,6 @@ void action_movetoedge(union ActionData *data)
|
||||||
int x, y;
|
int x, y;
|
||||||
ObClient *c = data->diraction.any.c;
|
ObClient *c = data->diraction.any.c;
|
||||||
|
|
||||||
if (!c)
|
|
||||||
return;
|
|
||||||
x = c->frame->area.x;
|
x = c->frame->area.x;
|
||||||
y = c->frame->area.y;
|
y = c->frame->area.y;
|
||||||
|
|
||||||
|
@ -1354,7 +1331,6 @@ void action_movetoedge(union ActionData *data)
|
||||||
client_action_start(data);
|
client_action_start(data);
|
||||||
client_move(c, x, y);
|
client_move(c, x, y);
|
||||||
client_action_end(data);
|
client_action_end(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_growtoedge(union ActionData *data)
|
void action_growtoedge(union ActionData *data)
|
||||||
|
@ -1363,9 +1339,6 @@ void action_growtoedge(union ActionData *data)
|
||||||
ObClient *c = data->diraction.any.c;
|
ObClient *c = data->diraction.any.c;
|
||||||
Rect *a;
|
Rect *a;
|
||||||
|
|
||||||
if (!c)
|
|
||||||
return;
|
|
||||||
|
|
||||||
a = screen_area(c->desktop);
|
a = screen_area(c->desktop);
|
||||||
x = c->frame->area.x;
|
x = c->frame->area.x;
|
||||||
y = c->frame->area.y;
|
y = c->frame->area.y;
|
||||||
|
@ -1424,22 +1397,19 @@ void action_growtoedge(union ActionData *data)
|
||||||
|
|
||||||
void action_send_to_layer(union ActionData *data)
|
void action_send_to_layer(union ActionData *data)
|
||||||
{
|
{
|
||||||
if (data->layer.any.c)
|
client_set_layer(data->layer.any.c, data->layer.layer);
|
||||||
client_set_layer(data->layer.any.c, data->layer.layer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_layer(union ActionData *data)
|
void action_toggle_layer(union ActionData *data)
|
||||||
{
|
{
|
||||||
ObClient *c = data->layer.any.c;
|
ObClient *c = data->layer.any.c;
|
||||||
|
|
||||||
if (c) {
|
client_action_start(data);
|
||||||
client_action_start(data);
|
if (data->layer.layer < 0)
|
||||||
if (data->layer.layer < 0)
|
client_set_layer(c, c->below ? 0 : -1);
|
||||||
client_set_layer(c, c->below ? 0 : -1);
|
else if (data->layer.layer > 0)
|
||||||
else if (data->layer.layer > 0)
|
client_set_layer(c, c->above ? 0 : 1);
|
||||||
client_set_layer(c, c->above ? 0 : 1);
|
client_action_end(data);
|
||||||
client_action_end(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void action_toggle_show_desktop(union ActionData *data)
|
void action_toggle_show_desktop(union ActionData *data)
|
||||||
|
|
|
@ -32,7 +32,15 @@ typedef struct _ObAction ObAction;
|
||||||
available (possibly NULL though) if it wants it.
|
available (possibly NULL though) if it wants it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
OB_CLIENT_ACTION_NO,
|
||||||
|
OB_CLIENT_ACTION_OPTIONAL,
|
||||||
|
OB_CLIENT_ACTION_ALWAYS
|
||||||
|
} ObClientActionReq;
|
||||||
|
|
||||||
struct AnyAction {
|
struct AnyAction {
|
||||||
|
ObClientActionReq client_action;
|
||||||
struct _ObClient *c;
|
struct _ObClient *c;
|
||||||
ObFrameContext context;
|
ObFrameContext context;
|
||||||
gboolean interactive;
|
gboolean interactive;
|
||||||
|
|
Loading…
Reference in a new issue