From 4ab212d0cd85ad7447b7c6bbee4c383f7e575d21 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 31 Aug 2003 18:54:26 +0000 Subject: [PATCH] make directional focusing an interactive action --- openbox/action.c | 50 +++++++++++++++++++++++------------------------- openbox/action.h | 8 +++++++- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/openbox/action.c b/openbox/action.c index 0d5e6e6c..c5c0e7ed 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -40,43 +40,51 @@ void action_free(ObAction *a) } void setup_action_directional_focus_north(ObAction *a) -{ - a->data.diraction.direction = OB_DIRECTION_NORTH; +{ + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_NORTH; } void setup_action_directional_focus_east(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_EAST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_EAST; } void setup_action_directional_focus_south(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_SOUTH; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_SOUTH; } void setup_action_directional_focus_west(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_WEST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_WEST; } void setup_action_directional_focus_northeast(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_NORTHEAST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_NORTHEAST; } void setup_action_directional_focus_southeast(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_SOUTHEAST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_SOUTHEAST; } void setup_action_directional_focus_southwest(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_SOUTHWEST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_SOUTHWEST; } void setup_action_directional_focus_northwest(ObAction *a) { - a->data.diraction.direction = OB_DIRECTION_NORTHWEST; + a->data.interdiraction.inter.any.interactive = TRUE; + a->data.interdiraction.direction = OB_DIRECTION_NORTHWEST; } void setup_action_send_to_desktop(ObAction *a) @@ -751,11 +759,6 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node) if ((n = parse_find_node("here", node->xmlChildrenNode))) act->data.activate.here = parse_bool(doc, n); } - - if (act->data.any.interactive) { - if ((n = parse_find_node("interactive",node->xmlChildrenNode))) - act->data.any.interactive = parse_bool(doc, n); - } } g_free(actname); } @@ -1089,22 +1092,17 @@ void action_showmenu(union ActionData *data) void action_cycle_windows(union ActionData *data) { - ObClient *c; - - c = focus_cycle(data->cycle.forward, data->cycle.linear, - data->cycle.inter.any.interactive, - data->cycle.inter.final, data->cycle.inter.cancel); + focus_cycle(data->cycle.forward, data->cycle.linear, + data->cycle.inter.any.interactive, + data->cycle.inter.final, data->cycle.inter.cancel); } void action_directional_focus(union ActionData *data) { - ObClient *nf; - - if (!data->diraction.any.c) - return; - if ((nf = client_find_directional(data->diraction.any.c, - data->diraction.direction))) - client_activate(nf, FALSE); + focus_directional_cycle(data->interdiraction.direction, + data->interdiraction.inter.any.interactive, + data->interdiraction.inter.final, + data->interdiraction.inter.cancel); } void action_movetoedge(union ActionData *data) diff --git a/openbox/action.h b/openbox/action.h index c6a04838..1b8f2156 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -22,6 +22,11 @@ struct InteractiveAction { gboolean cancel; }; +struct InterDirectionalAction{ + struct InteractiveAction inter; + ObDirection direction; +}; + struct DirectionalAction{ struct AnyAction any; ObDirection direction; @@ -101,6 +106,7 @@ struct CycleWindows { union ActionData { struct AnyAction any; struct InteractiveAction inter; + struct InterDirectionalAction interdiraction; struct DirectionalAction diraction; struct Execute execute; struct ClientAction client; @@ -220,7 +226,7 @@ void action_exit(union ActionData *data); void action_showmenu(union ActionData *data); /* CycleWindows */ void action_cycle_windows(union ActionData *data); -/* DirectionalAction */ +/* InterDirectionalAction */ void action_directional_focus(union ActionData *data); /* DirectionalAction */ void action_movetoedge(union ActionData *data); -- 2.45.2