]> Dogcows Code - chaz/openbox/commitdiff
make directional focusing an interactive action
authorDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 18:54:26 +0000 (18:54 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 31 Aug 2003 18:54:26 +0000 (18:54 +0000)
openbox/action.c
openbox/action.h

index 0d5e6e6caafd88f061321dc9ac484ca5eba5cafb..c5c0e7ed4313d7808e52d6bda89664a2925ee847 100644 (file)
@@ -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)
index c6a04838e25c6f0ebddca8fbaffdd35ff933bca4..1b8f2156d3a97e55d1280b6fbbb30d34d8a7c8ec 100644 (file)
@@ -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);
This page took 0.028951 seconds and 4 git commands to generate.