Pass a client set to all actions, and make focus cycling use a client set.
authorDana Jansens <danakj@orodu.net>
Wed, 3 Aug 2011 20:58:23 +0000 (16:58 -0400)
committerDana Jansens <danakj@orodu.net>
Sun, 16 Oct 2011 22:55:15 +0000 (18:55 -0400)
43 files changed:
openbox/action.c
openbox/action.h
openbox/action_list_run.c
openbox/actions/addremovedesktop.c
openbox/actions/breakchroot.c
openbox/actions/close.c
openbox/actions/cyclewindows.c
openbox/actions/debug.c
openbox/actions/decorations.c
openbox/actions/desktop.c
openbox/actions/directionalwindows.c
openbox/actions/dock.c
openbox/actions/dockautohide.c
openbox/actions/execute.c
openbox/actions/exit.c
openbox/actions/focus.c
openbox/actions/focustobottom.c
openbox/actions/fullscreen.c
openbox/actions/growtoedge.c
openbox/actions/iconify.c
openbox/actions/kill.c
openbox/actions/layer.c
openbox/actions/lower.c
openbox/actions/maximize.c
openbox/actions/move.c
openbox/actions/moverelative.c
openbox/actions/moveresizeto.c
openbox/actions/movetoedge.c
openbox/actions/omnipresent.c
openbox/actions/raise.c
openbox/actions/raiselower.c
openbox/actions/reconfigure.c
openbox/actions/resize.c
openbox/actions/resizerelative.c
openbox/actions/restart.c
openbox/actions/shade.c
openbox/actions/showdesktop.c
openbox/actions/showmenu.c
openbox/actions/unfocus.c
openbox/focus_cycle.c
openbox/focus_cycle.h
openbox/focus_cycle_popup.c
openbox/focus_cycle_popup.h

index 36dca017aaeb440719498bc78f96beef96a8b2e8..e134a652739210680831e12cf508744d76992aa1 100644 (file)
@@ -280,6 +280,9 @@ gboolean action_run(ObAction *act, const ObActionListRun *data,
        If the action is doing something to the currently focused window,
          then we want to update its user_time to indicate it was used by a
          human now.
+         - However, we only do this for non-interactive actions, as we expect
+           them to do their "thing" on every window in the set.  Interactive
+           actions generally let you choose one from a set to do stuff to.
     */
 
     run_i = FALSE;
@@ -304,15 +307,13 @@ gboolean action_run(ObAction *act, const ObActionListRun *data,
     if (run) {
         gboolean end;
 
-        /* XXX pass the set here */
-        end = !act->def->run(data, act->options);
+        end = !act->def->run(set, data, act->options);
         g_assert(end || action_is_interactive(act));
 
         if (end) {
             if (action_is_interactive(act))
                 action_interactive_end_act();
-            /* XXX else if (client_set_contains(focus_client)) */
-            else if (data->target && data->target == focus_client)
+            else if (client_set_contains(set, focus_client))
                 event_update_user_time();
         }
     }
index e6ec7de5b2611fb47e8a8b953059e5fc8f6fb834..376540ec6f107dcb9f42c2af95628ba7f501acb1 100644 (file)
@@ -33,7 +33,8 @@ typedef struct _ObAction             ObAction;
 typedef struct _ObActionData         ObActionData;
 
 typedef void     (*ObActionDataFreeFunc)(gpointer options);
-typedef gboolean (*ObActionRunFunc)(const struct _ObActionListRun *data,
+typedef gboolean (*ObActionRunFunc)(const struct _ObClientSet *set,
+                                    const struct _ObActionListRun *data,
                                     gpointer options);
 typedef gpointer (*ObActionDataSetupFunc)(GHashTable *config);
 typedef void     (*ObActionShutdownFunc)(void);
index 3e912f064759acddaa4cda3f8e1f497241d7d683..3187d8118883d156c09db8d4a5373a22dc05cc6c 100644 (file)
@@ -41,7 +41,6 @@ gboolean action_list_run(ObActionList *acts,
 {
     ObActionListRun action_data;
 
-    g_return_val_if_fail(acts != NULL, FALSE);
     if (acts == NULL) return FALSE;
 
     /* Don't save the initial mod state when running things from the menu */
index 22158daf1c3aa9813c2e76f948de84ac579ab88a..708086b42b07a3e1e5e86f19b29f29a2a068c686 100644 (file)
@@ -1,6 +1,7 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 #include <glib.h>
 
@@ -13,7 +14,8 @@ static gpointer setup_func(GHashTable *config);
 static gpointer setup_add_func(GHashTable *config);
 static gpointer setup_remove_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_addremovedesktop_startup(void)
 {
@@ -62,7 +64,8 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index de2da715f473ec3739dab14cf220ab3a35df2c23..e532f4c9aa676169afe2ecbbfb5a143cb20d64c3 100644 (file)
@@ -1,19 +1,20 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/keyboard.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_breakchroot_startup(void)
 {
-    action_register("BreakChroot",
-                    OB_ACTION_DEFAULT_FILTER_EMPTY,
-                    NULL, NULL,
-                    run_func);
+    action_register("BreakChroot", OB_ACTION_DEFAULT_FILTER_EMPTY,
+                    NULL, NULL, run_func);
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     /* break out of one chroot */
     keyboard_reset_chains(1);
index eb9db51b4294fa70cea449e75da435115cfd926b..5feb7d46e220336731a7826dcaed667bd7a9e255 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_close_startup(void)
 {
@@ -10,10 +12,22 @@ void action_close_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_close(c);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) client_close(data->target);
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_run, options);
+        action_client_move(data, FALSE);
+    }
 
     return FALSE;
 }
index 0087f8d50ee2ae835b3db5d1097926b60c21be5f..3a0bd8a8ab91f266d2583c9180e944adec8164ff 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_parser.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 #include "openbox/event.h"
@@ -15,8 +16,6 @@ typedef struct {
     gboolean linear;
     gboolean dock_windows;
     gboolean desktop_windows;
-    gboolean only_hilite_windows;
-    gboolean all_desktops;
     gboolean forward;
     gboolean bar;
     gboolean raise;
@@ -45,7 +44,8 @@ static gpointer setup_backward_func(GHashTable *config,
                                     ObActionICancelFunc *c,
                                     ObActionIPostFunc *post);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 static gboolean i_input_func(guint initial_state,
                              XEvent *e,
                              ObtIC *ic,
@@ -97,15 +97,9 @@ static gpointer setup_func(GHashTable *config,
     v = g_hash_table_lookup(config, "panels");
     if (v && action_value_is_string(v))
         o->dock_windows = action_value_bool(v);
-    v = g_hash_table_lookup(config, "hilite");
-    if (v && action_value_is_string(v))
-        o->only_hilite_windows = action_value_bool(v);
     v = g_hash_table_lookup(config, "desktop");
     if (v && action_value_is_string(v))
         o->desktop_windows = action_value_bool(v);
-    v = g_hash_table_lookup(config, "allDesktops");
-    if (v && action_value_is_string(v))
-        o->all_desktops = action_value_bool(v);
 
     v = g_hash_table_lookup(config, "finalactions");
     if (v && action_value_is_action_list(v)) {
@@ -157,14 +151,16 @@ static void free_func(gpointer options)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     struct _ObClient *ft;
 
-    ft = focus_cycle(o->forward,
-                     o->all_desktops,
-                     !o->only_hilite_windows,
+    if (client_set_is_empty(set)) return FALSE;
+
+    ft = focus_cycle(set,
+                     o->forward,
                      o->dock_windows,
                      o->desktop_windows,
                      o->linear,
@@ -235,9 +231,8 @@ static void i_post_func(gpointer options)
     Options *o = options;
     struct _ObClient *ft;
 
-    ft = focus_cycle(o->forward,
-                     o->all_desktops,
-                     !o->only_hilite_windows,
+    ft = focus_cycle(NULL,
+                     o->forward,
                      o->dock_windows,
                      o->desktop_windows,
                      o->linear,
index 74e47232e69a3b03439f6a319024d0edcb5c89bb..9f194958d6d2e1488adcc18d9a3e53847fd206df 100644 (file)
@@ -1,6 +1,7 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include <glib.h>
 
 typedef struct {
@@ -9,7 +10,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_debug_startup(void)
 {
@@ -38,7 +40,8 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index 05e6e1b6175f3dfb67bd0a4b8ac87a802e4076ac..037b9d57e57a67154f8049c3562cdc1ed8d75754 100644 (file)
@@ -1,10 +1,14 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func_on(const ObActionListRun *data, gpointer options);
-static gboolean run_func_off(const ObActionListRun *data, gpointer options);
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options);
 
 void action_decorations_startup(void)
 {
@@ -16,34 +20,55 @@ void action_decorations_startup(void)
                     NULL, NULL, run_func_toggle);
 }
 
+static gboolean each_on(ObClient *c, const ObActionListRun *data, gpointer o)
+{
+    client_set_undecorated(data->target, FALSE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_on(const ObActionListRun *data, gpointer options)
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_set_undecorated(data->target, FALSE);
+        client_set_run(set, data, each_on, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
 }
 
+static gboolean each_off(ObClient *c, const ObActionListRun *data, gpointer o)
+{
+    client_set_undecorated(data->target, TRUE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(const ObActionListRun *data, gpointer options)
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_set_undecorated(data->target, TRUE);
+        client_set_run(set, data, each_off, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
 }
 
+static gboolean each_flip(ObClient *c, const ObActionListRun *data, gpointer o)
+{
+    client_set_undecorated(data->target, !c->undecorated);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_set_undecorated(data->target, !data->target->undecorated);
+        client_set_run(set, data, each_flip, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
index 185e039b97caa7ce34f36e8e4a8c531c507568bf..b04ce3be19dd4f26c0711d43f2c8ffac9cdda20d 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_value.h"
 #include "openbox/screen.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/openbox.h"
 #include "obt/keyboard.h"
 
@@ -29,6 +30,10 @@ typedef struct {
     gboolean send;
     gboolean follow;
     gboolean interactive;
+
+    /* for the foreach function */
+    guint d;
+    GSList *moved;
 } Options;
 
 static gpointer setup_go_func(GHashTable *config,
@@ -42,7 +47,8 @@ static gpointer setup_send_func(GHashTable *config,
                                 ObActionICancelFunc *cancel,
                                 ObActionIPostFunc *post);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 static gboolean i_pre_func(guint state, gpointer options);
 static gboolean i_input_func(guint initial_state,
@@ -179,7 +185,19 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_send(ObClient *c, const ObActionListRun *data,
+                          gpointer options)
+{
+    Options *o = options;
+    if (client_normal(c)) {
+        client_set_desktop(c, o->d, o->follow, FALSE);
+        o->moved = g_slist_prepend(o->moved, c);
+    }
+    return TRUE;
+}
+
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     guint d;
@@ -202,22 +220,28 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
         g_assert_not_reached();
     }
 
-    if (d < screen_num_desktops &&
-        (d != screen_desktop ||
-         (data->target && data->target->desktop != screen_desktop))) {
-        gboolean go = TRUE;
+    if (d < screen_num_desktops) {        
+        gboolean go;
+
+        go = TRUE;
+        o->d = d;
+        o->moved = NULL;
 
         action_client_move(data, TRUE);
-        if (o->send && data->target && client_normal(data->target)) {
-            client_set_desktop(data->target, d, o->follow, FALSE);
+        if (o->send) {
+            client_set_run(set, data, each_send, o);
             go = o->follow;
         }
 
         if (go) {
-            screen_set_desktop(d, TRUE);
-            if (data->target)
-                client_bring_helper_windows(data->target);
+            GSList *it;
+
+            if (d != screen_desktop)
+                screen_set_desktop(d, TRUE);
+            for (it = o->moved; it; it = g_slist_next(it))
+                client_bring_helper_windows(it->data);
         }
+        g_slist_free(o->moved);
 
         action_client_move(data, FALSE);
     }
index e62e9b7fb0c1cc538d471e1af069de257eda9668..17b57c0a0bd918cd74292449e412dd4d0279445d 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_parser.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/event.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
@@ -33,7 +34,8 @@ static gpointer setup_cycle_func(GHashTable *config,
                                  ObActionIPostFunc *post);
 static gpointer setup_target_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 static gboolean i_input_func(guint initial_state,
                              XEvent *e,
                              ObtIC *ic,
@@ -145,16 +147,20 @@ static void free_func(gpointer options)
     g_slice_free(Options, o);
 }
 
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
+    if (client_set_is_empty(set)) return FALSE;
+
     if (!o->interactive)
         end_cycle(FALSE, data->mod_state, o);
     else {
         struct _ObClient *ft;
 
         ft = focus_directional_cycle(o->direction,
+                                     set,
                                      o->dock_windows,
                                      o->desktop_windows,
                                      TRUE,
@@ -223,6 +229,7 @@ static void end_cycle(gboolean cancel, guint state, Options *o)
     struct _ObClient *ft;
 
     ft = focus_directional_cycle(o->direction,
+                                 NULL,
                                  o->dock_windows,
                                  o->desktop_windows,
                                  o->interactive,
index d3aa2258fb6c9b5b94d0d32563ca6f942b1bd913..f555ec94af94ad2ce47e4c54d451b3eb930716f0 100644 (file)
@@ -1,11 +1,14 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 #include "openbox/dock.h"
 
-static gboolean raise_func(const ObActionListRun *data, gpointer options);
-static gboolean lower_func(const ObActionListRun *data, gpointer options);
+static gboolean raise_func(const ObClientSet *set,
+                           const ObActionListRun *data, gpointer options);
+static gboolean lower_func(const ObClientSet *set,
+                           const ObActionListRun *data, gpointer options);
 
 void action_dock_startup(void)
 {
@@ -16,7 +19,8 @@ void action_dock_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean raise_func(const ObActionListRun *data, gpointer options)
+static gboolean raise_func(const ObClientSet *set,
+                           const ObActionListRun *data, gpointer options)
 {
     action_client_move(data, TRUE);
     dock_raise_dock();
@@ -26,7 +30,8 @@ static gboolean raise_func(const ObActionListRun *data, gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean lower_func(const ObActionListRun *data, gpointer options)
+static gboolean lower_func(const ObClientSet *set,
+                           const ObActionListRun *data, gpointer options)
 {
     action_client_move(data, TRUE);
     dock_lower_dock();
index 6b31d87310538a259a012cf17b6c2a2109bfb361..e21d80921264bf094c81aa6c187818416c9e8c88 100644 (file)
@@ -1,9 +1,11 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
-#include "openbox/dock.h"
+#include "openbox/client_set.h"
 #include "openbox/config.h"
+#include "openbox/dock.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_dockautohide_startup(void)
 {
@@ -12,10 +14,13 @@ void action_dockautohide_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     config_dock_hide = !config_dock_hide;
+    action_client_move(data, TRUE);
     dock_configure();
+    action_client_move(data, FALSE);
 
     return FALSE;
 }
index 22879bcca412ca065fc2339d14fe37057971173c..e4f99dd20873b1db2ec6398b162cdae6d6343d26 100644 (file)
@@ -1,11 +1,12 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
-#include "openbox/event.h"
-#include "openbox/startupnotify.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
+#include "openbox/event.h"
 #include "openbox/prompt.h"
 #include "openbox/screen.h"
+#include "openbox/startupnotify.h"
 #include "obt/paths.h"
 #include "gettext.h"
 
@@ -20,12 +21,16 @@ typedef struct {
     gchar   *sn_icon;
     gchar   *sn_wmclass;
     gchar   *prompt;
+
+    /* for the prompt callback */
     ObActionListRun *data;
+    ObClientSet *set;
 } Options;
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 static void shutdown_func(void);
 static void client_dest(ObClient *client, gpointer data);
 
@@ -99,12 +104,14 @@ static void free_func(gpointer options)
         g_free(o->sn_icon);
         g_free(o->sn_wmclass);
         g_free(o->prompt);
+        if (o->set) client_set_destroy(o->set);
         if (o->data) g_slice_free(ObActionListRun, o->data);
         g_slice_free(Options, o);
     }
 }
 
-static Options* dup_options(Options *in, const ObActionListRun *data)
+static Options* dup_options(Options *in, const ObClientSet *set,
+                            const ObActionListRun *data)
 {
     Options *o = g_slice_new(Options);
     o->cmd = g_strdup(in->cmd);
@@ -113,50 +120,19 @@ static Options* dup_options(Options *in, const ObActionListRun *data)
     o->sn_icon = g_strdup(in->sn_icon);
     o->sn_wmclass = g_strdup(in->sn_wmclass);
     o->prompt = NULL;
+    o->set = client_set_clone(set);
     o->data = g_slice_new(ObActionListRun);
     memcpy(o->data, data, sizeof(ObActionListRun));
     return o;
 }
 
-static gboolean prompt_cb(ObPrompt *p, gint result, gpointer options)
+static gboolean do_execute_each(ObClient *client,
+                                const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
-    if (result)
-        run_func(o->data, o);
-    return TRUE; /* call the cleanup func */
-}
-
-static void prompt_cleanup(ObPrompt *p, gpointer options)
-{
-    prompt_unref(p);
-    free_func(options);
-}
-
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
-{
     GError *e;
     gchar **argv = NULL;
     gchar *cmd;
-    Options *o = options;
-
-    if (!o->cmd) return FALSE;
-
-    if (o->prompt) {
-        ObPrompt *p;
-        Options *ocp;
-        ObPromptAnswer answers[] = {
-            { _("No"), 0 },
-            { _("Yes"), 1 }
-        };
-
-        ocp = dup_options(options, data);
-        p = prompt_new(o->prompt, _("Execute"), answers, 2, 0, 0,
-                       prompt_cb, prompt_cleanup, ocp);
-        prompt_show(p, NULL, FALSE);
-
-        return FALSE;
-    }
 
     cmd = g_filename_from_utf8(o->cmd, -1, NULL, NULL, NULL);
     if (!cmd) {
@@ -164,7 +140,7 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
         return FALSE;
     }
 
-    if (data->target) {
+    if (client) {
         gchar *c, *before, *expand;
 
         /* replace occurrences of $pid and $wid */
@@ -186,7 +162,7 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
                 expand = g_strdup_printf("%s%s%u",
                                          (expand ? expand : ""),
                                          before,
-                                         data->target->pid);
+                                         client->pid);
                 g_free(tmp);
 
                 before = c + 4; /* 4 = strlen("$pid") */
@@ -204,7 +180,7 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
                 expand = g_strdup_printf("%s%s%lu",
                                          (expand ? expand : ""),
                                          before,
-                                         data->target->window);
+                                         client->window);
                 g_free(tmp);
 
                 before = c + 4; /* 4 = strlen("$wid") */
@@ -271,5 +247,57 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
 
     g_free(cmd);
 
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean do_execute(const ObClientSet *set,
+                           const ObActionListRun *data, gpointer options)
+{
+    if (client_set_is_empty(set))
+        do_execute_each(NULL, data, options);
+    else
+        client_set_run(set, data, do_execute_each, options);
     return FALSE;
 }
+
+static gboolean prompt_cb(ObPrompt *p, gint result, gpointer options)
+{
+    Options *o = options;
+    if (result)
+        run_func(o->set, o->data, o);
+    return TRUE; /* call the cleanup func */
+}
+
+static void prompt_cleanup(ObPrompt *p, gpointer options)
+{
+    prompt_unref(p);
+    free_func(options);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    Options *o = options;
+
+    if (!o->cmd) return FALSE;
+
+    if (o->prompt) {
+        ObPrompt *p;
+        Options *ocp;
+        ObPromptAnswer answers[] = {
+            { _("No"), 0 },
+            { _("Yes"), 1 }
+        };
+
+        ocp = dup_options(options, set, data);
+        p = prompt_new(o->prompt, _("Execute"), answers, 2, 0, 0,
+                       prompt_cb, prompt_cleanup, ocp);
+        prompt_show(p, NULL, FALSE);
+
+        return FALSE;
+    }
+
+    return do_execute(set, data, options);
+}
index 5be209e34074156871e5a2bf6b01a6d3f72437c6..ae061e15a1a975c76c51b18e3b744d48b0f5b964 100644 (file)
@@ -1,6 +1,7 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/openbox.h"
 #include "openbox/prompt.h"
 #include "openbox/session.h"
@@ -12,7 +13,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_exit_startup(void)
 {
@@ -62,7 +64,8 @@ static void prompt_cleanup(ObPrompt *p, gpointer data)
 
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index f1e6f29216102f5e0dca9c0a592c9e573be19221..64af985c3a7dcbd0e4c8f275ef83dad484ae2188 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_value.h"
 #include "openbox/event.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/focus.h"
 #include "openbox/screen.h"
 
@@ -13,7 +14,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_focus_startup(void)
 {
@@ -43,38 +45,50 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_focus(ObClient *c, const ObActionListRun *data,
+                           gpointer options)
 {
     Options *o = options;
 
-    if (data->target) {
 /*
-        ob_debug("button %d focusable %d context %d %d %d\n",
-                 data->button, client_mouse_focusable(data->client),
-                 data->context,
-                 OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
+    ob_debug("button %d focusable %d context %d %d %d\n",
+             data->button, client_mouse_focusable(data->client),
+             data->context,
+             OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
 */
-        if (data->pointer_button == 0 ||
-            client_mouse_focusable(data->target) ||
-            (data->pointer_context != OB_FRAME_CONTEXT_CLIENT &&
-             data->pointer_context != OB_FRAME_CONTEXT_FRAME))
-        {
-            if (o->stop_int)
-                action_interactive_cancel_act();
-
-            action_client_move(data, TRUE);
-            client_activate(data->target, TRUE, o->here, FALSE, FALSE, TRUE);
-            action_client_move(data, FALSE);
-        }
-    } else if (data->pointer_context == OB_FRAME_CONTEXT_DESKTOP) {
+    if (data->pointer_button == 0 ||
+        client_mouse_focusable(c) ||
+        (data->pointer_context != OB_FRAME_CONTEXT_CLIENT &&
+         data->pointer_context != OB_FRAME_CONTEXT_FRAME))
+    {
         if (o->stop_int)
             action_interactive_cancel_act();
 
+        client_activate(c, TRUE, o->here, FALSE, FALSE, TRUE);
+    }
+
+    return FALSE; /* only do this to one client */
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    Options *o = options;
+
+    if (client_set_is_empty(set)) {
+        if (data->pointer_context == OB_FRAME_CONTEXT_DESKTOP)
+            if (o->stop_int)
+                action_interactive_cancel_act();
+
         /* focus action on the root window. make keybindings work for this
            openbox instance, but don't focus any specific client */
         focus_nothing();
     }
-
+    else {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_focus, options);
+        action_client_move(data, FALSE);
+    }
     return FALSE;
 }
index 942d788717813fdbf06d79fa65c3c85f7c96ec3e..ea168ae389106b5e5d11bc2e919483eec05cbb09 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/focus.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_focustobottom_startup(void)
 {
@@ -10,10 +12,17 @@ void action_focustobottom_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(struct _ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    focus_order_to_bottom(c);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target)
-        focus_order_to_bottom(data->target);
+    client_set_run(set, data, each_run, options);
     return FALSE;
 }
index 68f0738d0cccd6177bb550a687684d131861ff86..1abc3cbbfa2304f30a1b5bba38c8e05fb83a9194 100644 (file)
@@ -1,21 +1,73 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options);
 
 void action_fullscreen_startup(void)
 {
+    action_register("Fullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
+                    NULL, NULL, run_func_on);
+    action_register("Unfullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
+                    NULL, NULL, run_func_off);
     action_register("ToggleFullscreen", OB_ACTION_DEFAULT_FILTER_SINGLE,
                     NULL, NULL, run_func_toggle);
 }
 
+static gboolean each_on(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_fullscreen(c, TRUE);
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options)
+{
+    action_client_move(data, TRUE);
+    client_set_run(set, data, each_on, options);
+    action_client_move(data, FALSE);
+    return FALSE;
+}
+
+static gboolean each_off(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_fullscreen(c, FALSE);
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options)
+{
+    action_client_move(data, TRUE);
+    client_set_run(set, data, each_off, options);
+    action_client_move(data, FALSE);
+    return FALSE;
+}
+
+static gboolean each_toggle(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_fullscreen(c, !c->fullscreen);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_fullscreen(data->target, !data->target->fullscreen);
+        client_set_run(set, data, each_toggle, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
index 7bfebe105791eefc05be862fbe7fc5f1437c9285..55f6a90cdfa94ddc817cec617bf60d6dfb5f9199 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_value.h"
 #include "openbox/misc.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/frame.h"
 #include "openbox/screen.h"
 #include <glib.h>
@@ -15,7 +16,8 @@ typedef struct {
 static gpointer setup_func(GHashTable *config);
 static gpointer setup_shrink_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_growtoedge_startup(void)
 {
@@ -81,9 +83,7 @@ static gboolean do_grow(const ObActionListRun *data, gint x, gint y, gint w, gin
         realw != data->target->area.width ||
         realh != data->target->area.height)
     {
-        action_client_move(data, TRUE);
         client_move_resize(data->target, x, y, realw, realh);
-        action_client_move(data, FALSE);
         return TRUE;
     }
     return FALSE;
@@ -94,28 +94,27 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
     gint x, y, w, h;
     ObDirection opp;
     gint half;
 
-    if (!data->target ||
+    if (!c ||
         /* don't allow vertical resize if shaded */
         ((o->dir == OB_DIRECTION_NORTH || o->dir == OB_DIRECTION_SOUTH) &&
-         data->target->shaded))
+         c->shaded))
     {
-        return FALSE;
+        return TRUE;
     }
 
     if (!o->shrink) {
         /* try grow */
-        client_find_resize_directional(data->target, o->dir, TRUE,
-                                       &x, &y, &w, &h);
+        client_find_resize_directional(c, o->dir, TRUE, &x, &y, &w, &h);
         if (do_grow(data, x, y, w, h))
-            return FALSE;
+            return TRUE;
     }
 
     /* we couldn't grow, so try shrink! */
@@ -123,37 +122,48 @@ static gboolean run_func(const ObActionListRun *data, gpointer options)
            (o->dir == OB_DIRECTION_SOUTH ? OB_DIRECTION_NORTH :
             (o->dir == OB_DIRECTION_EAST ? OB_DIRECTION_WEST :
              OB_DIRECTION_EAST)));
-    client_find_resize_directional(data->target, opp, FALSE,
-                                   &x, &y, &w, &h);
+    client_find_resize_directional(c, opp, FALSE, &x, &y, &w, &h);
     switch (opp) {
     case OB_DIRECTION_NORTH:
-        half = data->target->area.y + data->target->area.height / 2;
+        half = c->area.y + c->area.height / 2;
         if (y > half) {
             h += y - half;
             y = half;
         }
         break;
     case OB_DIRECTION_SOUTH:
-        half = data->target->area.height / 2;
+        half = c->area.height / 2;
         if (h < half)
             h = half;
         break;
     case OB_DIRECTION_WEST:
-        half = data->target->area.x + data->target->area.width / 2;
+        half = c->area.x + c->area.width / 2;
         if (x > half) {
             w += x - half;
             x = half;
         }
         break;
     case OB_DIRECTION_EAST:
-        half = data->target->area.width / 2;
+        half = c->area.width / 2;
         if (w < half)
             w = half;
         break;
     default: g_assert_not_reached();
     }
     if (do_grow(data, x, y, w, h))
-        return FALSE;
+        return TRUE;
+
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_run, options);
+        action_client_move(data, FALSE);
+    }
     return FALSE;
 }
index fddf8f9d36c8f31c309986e927cf7aab1b5c9124..da0942e8e4eadbf8151b16ad4777e04512638e55 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_iconify_startup(void)
 {
@@ -10,14 +12,21 @@ void action_iconify_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_iconify(c, TRUE, TRUE, FALSE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_iconify(data->target, TRUE, TRUE, FALSE);
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
-
     return FALSE;
 }
index f3f39539a2e206b59b81b4f9e34d2251c6693653..f428c797514287c1153b6dc45dd00ae7a6f503f8 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_kill_startup(void)
 {
@@ -10,11 +12,21 @@ void action_kill_startup(void)
                     NULL, NULL, run_func);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
-    if (data->target)
-        client_kill(data->target);
+    client_kill(c);
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_run, options);
+        action_client_move(data, FALSE);
+    }
     return FALSE;
 }
index 646f20d213d694c0ad6e671dc52c285784f962ba..8da564468d30d6c9ae7bb4bceff0fc5c66ff3758 100644 (file)
@@ -2,6 +2,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
 typedef struct {
     gint layer; /*!< -1 for below, 0 for normal, and 1 for above */
@@ -12,7 +13,8 @@ static gpointer setup_func_top(GHashTable *config);
 static gpointer setup_func_bottom(GHashTable *config);
 static gpointer setup_func_send(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_layer_startup(void)
 {
@@ -69,29 +71,32 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
 
-    if (data->target) {
-        ObClient *c = data->target;
+    if (o->layer < 0) {
+        if (o->toggle || !c->below)
+            client_set_layer(c, c->below ? 0 : -1);
+    }
+    else if (o->layer > 0) {
+        if (o->toggle || !c->above)
+            client_set_layer(c, c->above ? 0 : 1);
+    }
+    else if (c->above || c->below)
+        client_set_layer(c, 0);
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-
-        if (o->layer < 0) {
-            if (o->toggle || !c->below)
-                client_set_layer(c, c->below ? 0 : -1);
-        }
-        else if (o->layer > 0) {
-            if (o->toggle || !c->above)
-                client_set_layer(c, c->above ? 0 : 1);
-        }
-        else if (c->above || c->below)
-            client_set_layer(c, 0);
-
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
-
     return FALSE;
 }
index a95a28297f1cd9d618f42c655dd8247d92f4398b..f2acc1a1ee4bd1da320b0cbf4b7943232f6e22c0 100644 (file)
@@ -1,9 +1,11 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_lower_startup(void)
 {
@@ -11,12 +13,20 @@ void action_lower_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(struct _ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    stacking_lower(CLIENT_AS_WINDOW(c));
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        stacking_lower(CLIENT_AS_WINDOW(data->target));
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
 
index 71c67e545eede5b012bd618d94b2e6bba1aa12b5..325a4fe44136fdb0e2ec2cc9d2a1ae24c6580b54 100644 (file)
@@ -2,6 +2,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
 /* These match the values for client_maximize */
 typedef enum {
@@ -16,9 +17,12 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func_on(const ObActionListRun *data, gpointer options);
-static gboolean run_func_off(const ObActionListRun *data, gpointer options);
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options);
 
 void action_maximize_startup(void)
 {
@@ -57,8 +61,8 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func_on(const ObActionListRun *data, gpointer options)
+static gboolean each_on(ObClient *c, const ObActionListRun *data,
+                        gpointer options)
 {
     Options *o = options;
     if (data->target) {
@@ -66,11 +70,23 @@ static gboolean run_func_on(const ObActionListRun *data, gpointer options)
         client_maximize(data->target, TRUE, o->dir);
         action_client_move(data, FALSE);
     }
-    return FALSE;
+    return TRUE;
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(const ObActionListRun *data, gpointer options)
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_on, options);
+        action_client_move(data, FALSE);
+    }
+    return FALSE;
+}
+
+static gboolean each_off(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
     if (data->target) {
@@ -78,21 +94,41 @@ static gboolean run_func_off(const ObActionListRun *data, gpointer options)
         client_maximize(data->target, FALSE, o->dir);
         action_client_move(data, FALSE);
     }
-    return FALSE;
+    return TRUE;
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_off, options);
+        action_client_move(data, FALSE);
+    }
+    return FALSE;
+}
+
+static gboolean each_toggle(ObClient *c, const ObActionListRun *data,
+                            gpointer options)
 {
     Options *o = options;
-    if (data->target) {
-        gboolean toggle;
+    gboolean toggle;
+    toggle = ((o->dir == HORZ && !data->target->max_horz) ||
+              (o->dir == VERT && !data->target->max_vert) ||
+              (o->dir == BOTH &&
+               !(data->target->max_horz && data->target->max_vert)));
+    client_maximize(data->target, toggle, o->dir);
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        toggle = ((o->dir == HORZ && !data->target->max_horz) ||
-                  (o->dir == VERT && !data->target->max_vert) ||
-                  (o->dir == BOTH &&
-                   !(data->target->max_horz && data->target->max_vert)));
-        client_maximize(data->target, toggle, o->dir);
+        client_set_run(set, data, each_toggle, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
index 883fe71a3e497cc4250f0ccd18d627e3430f8835..bef6a75f55891d614a54941c78872f3b8b43726d 100644 (file)
@@ -1,9 +1,12 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/moveresize.h"
 #include "obt/prop.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_move_startup(void)
 {
@@ -12,18 +15,25 @@ void action_move_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
-        guint32 corner;
+    GList *list;
+    guint32 corner;
+    ObClient *c;
 
-        corner = data->pointer_button != 0 ?
-            OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) :
-            OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD);
+    /* XXX only works on sets of size 1 right now until moveresize changes */
+    if (client_set_size(set) != 1) return FALSE;
 
-        moveresize_start(data->target, data->pointer_x, data->pointer_y,
-                         data->pointer_button, corner);
-    }
+    list = client_set_get_all(set);
+    c = list->data;
+    g_list_free(list);
 
+    corner = data->pointer_button != 0 ?
+        OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) :
+        OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD);
+
+    moveresize_start(c, data->pointer_x, data->pointer_y,
+                     data->pointer_button, corner);
     return FALSE;
 }
index 36504b09d44572b316e2294d1e566bcf36999b69..9a05bfcd7c7c71b5b4ba9f0a8015462adc5fb763 100644 (file)
@@ -2,6 +2,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 #include "openbox/frame.h"
 #include "openbox/config.h"
@@ -15,7 +16,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_moverelative_startup(void)
 {
@@ -45,38 +47,41 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
+    gint x, y, lw, lh, w, h;
 
-    if (data->target) {
-        ObClient *c;
-        gint x, y, lw, lh, w, h;
-
-        c = data->target;
-        x = o->x;
-        y = o->y;
-        if (o->x_denom || o->y_denom) {
-            const Rect *carea;
+    x = o->x;
+    y = o->y;
+    if (o->x_denom || o->y_denom) {
+        const Rect *carea;
 
-            carea = screen_area(c->desktop, client_monitor(c), NULL);
-            if (o->x_denom)
-                x = (x * carea->width) / o->x_denom;
-            if (o->y_denom)
-                y = (y * carea->height) / o->y_denom;
-        }
-        x = c->area.x + x;
-        y = c->area.y + y;
-        w = c->area.width;
-        h = c->area.height;
-        client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
-        client_find_onscreen(c, &x, &y, w, h, FALSE);
+        carea = screen_area(c->desktop, client_monitor(c), NULL);
+        if (o->x_denom)
+            x = (x * carea->width) / o->x_denom;
+        if (o->y_denom)
+            y = (y * carea->height) / o->y_denom;
+    }
+    x = c->area.x + x;
+    y = c->area.y + y;
+    w = c->area.width;
+    h = c->area.height;
+    client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
+    client_find_onscreen(c, &x, &y, w, h, FALSE);
+    client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
-
     return FALSE;
 }
index 06acd2dd46ed158e61b79f5f51ffad049120c92a..03f1c75e0fad422f08ec882e4aad16d32c6b4308 100644 (file)
@@ -2,6 +2,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 #include "openbox/frame.h"
 #include "openbox/config.h"
@@ -25,7 +26,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_moveresizeto_startup(void)
 {
@@ -84,86 +86,90 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
+    Rect *area, *carea;
+    guint mon, cmon;
+    gint x, y, lw, lh, w, h;
+
+    mon = o->monitor;
+    cmon = client_monitor(c);
+    switch (mon) {
+    case CURRENT_MONITOR:
+        mon = cmon; break;
+    case ALL_MONITORS:
+        mon = SCREEN_AREA_ALL_MONITORS; break;
+    case NEXT_MONITOR:
+        mon = (cmon + 1 > screen_num_monitors - 1) ? 0 : (cmon + 1); break;
+    case PREV_MONITOR:
+        mon = (cmon == 0) ? (screen_num_monitors - 1) : (cmon - 1); break;
+    default:
+        g_assert_not_reached();
+    }
 
-    if (data->target) {
-        Rect *area, *carea;
-        ObClient *c;
-        guint mon, cmon;
-        gint x, y, lw, lh, w, h;
-
-        c = data->target;
-        mon = o->monitor;
-        cmon = client_monitor(c);
-        switch (mon) {
-        case CURRENT_MONITOR:
-            mon = cmon; break;
-        case ALL_MONITORS:
-            mon = SCREEN_AREA_ALL_MONITORS; break;
-        case NEXT_MONITOR:
-            mon = (cmon + 1 > screen_num_monitors - 1) ? 0 : (cmon + 1); break;
-        case PREV_MONITOR:
-            mon = (cmon == 0) ? (screen_num_monitors - 1) : (cmon - 1); break;
-        default:
-            g_assert_not_reached();
-        }
-
-        area = screen_area(c->desktop, mon, NULL);
-        carea = screen_area(c->desktop, cmon, NULL);
-
-        w = o->w;
-        if (w == G_MININT) w = c->area.width;
-        else if (o->w_denom) w = (w * area->width) / o->w_denom;
-
-        h = o->h;
-        if (h == G_MININT) h = c->area.height;
-        else if (o->h_denom) h = (h * area->height) / o->h_denom;
-
-        /* it might not be able to resize how they requested, so find out what
-           it will actually be resized to */
-        x = c->area.x;
-        y = c->area.y;
-        client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
-
-        /* get the frame's size */
-        w += c->frame->size.left + c->frame->size.right;
-        h += c->frame->size.top + c->frame->size.bottom;
-
-        x = o->x.pos;
-        if (o->x.denom)
-            x = (x * area->width) / o->x.denom;
-        if (o->x.center) x = (area->width - w) / 2;
-        else if (x == G_MININT) x = c->frame->area.x - carea->x;
-        else if (o->x.opposite) x = area->width - w - x;
-        x += area->x;
-
-        y = o->y.pos;
-        if (o->y.denom)
-            y = (y * area->height) / o->y.denom;
-        if (o->y.center) y = (area->height - h) / 2;
-        else if (y == G_MININT) y = c->frame->area.y - carea->y;
-        else if (o->y.opposite) y = area->height - h - y;
-        y += area->y;
-
-        /* get the client's size back */
-        w -= c->frame->size.left + c->frame->size.right;
-        h -= c->frame->size.top + c->frame->size.bottom;
-
-        frame_frame_gravity(c->frame, &x, &y); /* get the client coords */
-        client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
-        /* force it on screen if its moving to another monitor */
-        client_find_onscreen(c, &x, &y, w, h, mon != cmon);
+    area = screen_area(c->desktop, mon, NULL);
+    carea = screen_area(c->desktop, cmon, NULL);
+
+    w = o->w;
+    if (w == G_MININT) w = c->area.width;
+    else if (o->w_denom) w = (w * area->width) / o->w_denom;
+
+    h = o->h;
+    if (h == G_MININT) h = c->area.height;
+    else if (o->h_denom) h = (h * area->height) / o->h_denom;
+
+    /* it might not be able to resize how they requested, so find out what
+       it will actually be resized to */
+    x = c->area.x;
+    y = c->area.y;
+    client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
+
+    /* get the frame's size */
+    w += c->frame->size.left + c->frame->size.right;
+    h += c->frame->size.top + c->frame->size.bottom;
+
+    x = o->x.pos;
+    if (o->x.denom)
+        x = (x * area->width) / o->x.denom;
+    if (o->x.center) x = (area->width - w) / 2;
+    else if (x == G_MININT) x = c->frame->area.x - carea->x;
+    else if (o->x.opposite) x = area->width - w - x;
+    x += area->x;
+
+    y = o->y.pos;
+    if (o->y.denom)
+        y = (y * area->height) / o->y.denom;
+    if (o->y.center) y = (area->height - h) / 2;
+    else if (y == G_MININT) y = c->frame->area.y - carea->y;
+    else if (o->y.opposite) y = area->height - h - y;
+    y += area->y;
+
+    /* get the client's size back */
+    w -= c->frame->size.left + c->frame->size.right;
+    h -= c->frame->size.top + c->frame->size.bottom;
+
+    frame_frame_gravity(c->frame, &x, &y); /* get the client coords */
+    client_try_configure(c, &x, &y, &w, &h, &lw, &lh, TRUE);
+    /* force it on screen if its moving to another monitor */
+    client_find_onscreen(c, &x, &y, w, h, mon != cmon);
+
+    client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
+
+    g_slice_free(Rect, area);
+    g_slice_free(Rect, carea);
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_configure(c, x, y, w, h, TRUE, TRUE, FALSE);
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
-
-        g_slice_free(Rect, area);
-        g_slice_free(Rect, carea);
     }
-
     return FALSE;
 }
index c5f8062d9c8bb170178520886d2c73f1d921a765..5ff1def712c9a9236a1ca6e82987051810e8aeca 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_value.h"
 #include "openbox/misc.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/frame.h"
 #include "openbox/geom.h"
 #include <glib.h>
@@ -13,7 +14,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_movetoedge_startup(void)
 {
@@ -54,21 +56,26 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
+    gint x, y;
 
-    if (data->target) {
-        gint x, y;
+    client_find_move_directional(c, o->dir, &x, &y);
+    if (x != c->area.x || y != c->area.y)
+        client_move(c, x, y);
+    return TRUE;
+}
 
-        client_find_move_directional(data->target, o->dir, &x, &y);
-        if (x != data->target->area.x || y != data->target->area.y) {
-            action_client_move(data, TRUE);
-            client_move(data->target, x, y);
-            action_client_move(data, FALSE);
-        }
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_run, options);
+        action_client_move(data, FALSE);
     }
-
     return FALSE;
 }
index 7fc950c4e43e7a22b4ab5577e57a2d901a303e0e..1bc304f60084ddf12c5280c2d88e7c25e363e9b7 100644 (file)
@@ -1,24 +1,79 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options);
 
 void action_omnipresent_startup(void)
 {
+    action_register("Omnipresent", OB_ACTION_DEFAULT_FILTER_SINGLE,
+                    NULL, NULL, run_func_on);
+    action_register("Unomnipresent", OB_ACTION_DEFAULT_FILTER_SINGLE,
+                    NULL, NULL, run_func_off);
     action_register("ToggleOmnipresent", OB_ACTION_DEFAULT_FILTER_SINGLE,
                     NULL, NULL, run_func_toggle);
 }
 
+static gboolean each_off(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_set_desktop(c, FALSE, FALSE, TRUE);
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_off, options);
+        action_client_move(data, FALSE);
+    }
+    return FALSE;
+}
+
+static gboolean each_on(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_set_desktop(c, TRUE, FALSE, TRUE);
+    return TRUE;
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
+        action_client_move(data, TRUE);
+        client_set_run(set, data, each_on, options);
+        action_client_move(data, FALSE);
+    }
+    return FALSE;
+}
+
+static gboolean each_toggle(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    gboolean omni = c->desktop == DESKTOP_ALL ? screen_desktop : DESKTOP_ALL;
+    client_set_desktop(c, omni, FALSE, TRUE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_set_desktop(data->target,
-                           data->target->desktop == DESKTOP_ALL ?
-                           screen_desktop : DESKTOP_ALL, FALSE, TRUE);
+        client_set_run(set, data, each_toggle, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
index 694a19c5fe0ee35687a55692d4c36b5a96560b69..bac4492d13d3aeb51dee835d7924bf50974d031b 100644 (file)
@@ -1,9 +1,11 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/stacking.h"
 #include "openbox/window.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_raise_startup(void)
 {
@@ -11,12 +13,20 @@ void action_raise_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(struct _ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    stacking_raise(CLIENT_AS_WINDOW(c));
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        stacking_raise(CLIENT_AS_WINDOW(data->target));
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
 
index abb85de771c93a86944882b5515dab580df6fdf3..88eece6cc5efc80de30f01d71c4496946351dc6f 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/stacking.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_raiselower_startup(void)
 {
@@ -10,12 +12,20 @@ void action_raiselower_startup(void)
                     NULL, NULL, run_func);
 }
 
+static gboolean each_run(struct _ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    stacking_restack_request(c, NULL, Opposite);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target) {
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        stacking_restack_request(data->target, NULL, Opposite);
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
 
index 13966c4d34aebbcf5f424439f3a4c29b93774000..11cf1a4bf6fd70218b75a2e8ee33f126ac1b33ea 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/openbox.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_reconfigure_startup(void)
 {
@@ -11,7 +13,8 @@ void action_reconfigure_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     ob_reconfigure();
 
index 15572bf216f7843005acfa976db1d0c74391738c..010aaba54fad9e7479dbc28bf18ec1fb135b4c14 100644 (file)
@@ -3,6 +3,7 @@
 #include "openbox/action_value.h"
 #include "openbox/moveresize.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/frame.h"
 #include "obt/prop.h"
 
@@ -13,7 +14,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void free_func(gpointer o);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 static guint32 pick_corner(gint x, gint y, gint cx, gint cy, gint cw, gint ch,
                            gboolean shaded);
@@ -64,34 +66,39 @@ static void free_func(gpointer o)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
+    GList *list;
+    struct _ObClient *c;
+    guint32 corner;
 
-    if (data->target) {
-        ObClient *c = data->target;
-        guint32 corner;
+    /* only works on a single client */
+    if (client_set_size(set) != 1) return FALSE;
 
-        if (!data->pointer_button)
-            corner = OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD);
-        else if (o->corner_specified)
-            corner = o->corner; /* it was specified in the binding */
-        else
-            corner = pick_corner(data->pointer_x, data->pointer_y,
-                                 c->frame->area.x, c->frame->area.y,
-                                 /* use the client size because the frame
-                                    can be differently sized (shaded
-                                    windows) and we want this based on the
-                                    clients size */
-                                 c->area.width + c->frame->size.left +
-                                 c->frame->size.right,
-                                 c->area.height + c->frame->size.top +
-                                 c->frame->size.bottom, c->shaded);
-
-        moveresize_start(c, data->pointer_x, data->pointer_y,
-                         data->pointer_button, corner);
-    }
+    list = client_set_get_all(set);
+    c = list->data;
+    g_list_free(list);
 
+    if (!data->pointer_button)
+        corner = OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD);
+    else if (o->corner_specified)
+        corner = o->corner; /* it was specified in the binding */
+    else
+        corner = pick_corner(data->pointer_x, data->pointer_y,
+                             c->frame->area.x, c->frame->area.y,
+                             /* use the client size because the frame
+                                can be differently sized (shaded
+                                windows) and we want this based on the
+                                clients size */
+                             c->area.width + c->frame->size.left +
+                             c->frame->size.right,
+                             c->area.height + c->frame->size.top +
+                             c->frame->size.bottom, c->shaded);
+
+    moveresize_start(c, data->pointer_x, data->pointer_y,
+                     data->pointer_button, corner);
     return FALSE;
 }
 
index 7cf986c215986d9e209b51c6c6f3080f9b75ba45..933d0aa939a8e95b56fea834a66f795bcd043105 100644 (file)
@@ -2,6 +2,7 @@
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 #include "openbox/frame.h"
 #include "openbox/config.h"
@@ -19,7 +20,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_resizerelative_startup(void)
 {
@@ -55,46 +57,51 @@ static void free_func(gpointer o)
     g_slice_free(Options, o);
 }
 
-/* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean each_run(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
 {
     Options *o = options;
+    gint x, y, ow, xoff, nw, oh, yoff, nh, lw, lh;
+    gint left = o->left, right = o->right, top = o->top, bottom = o->bottom;
+
+    if (o->left_denom)
+        left = (left * c->area.width / c->size_inc.width) / o->left_denom;
+    if (o->right_denom)
+        right = (right * c->area.width / c->size_inc.width) / o->right_denom;
+    if (o->top_denom)
+        top = (top * c->area.height / c->size_inc.height) / o->top_denom;
+    if (o->bottom_denom)
+        bottom = (bottom * c->area.height / c->size_inc.height) /
+            o->bottom_denom;
 
-    if (data->target) {
-        ObClient *c = data->target;
-        gint x, y, ow, xoff, nw, oh, yoff, nh, lw, lh;
-        gint left = o->left, right = o->right, top = o->top, bottom = o->bottom;
+    x = c->area.x;
+    y = c->area.y;
+    ow = c->area.width;
+    xoff = -left * c->size_inc.width;
+    nw = ow + right * c->size_inc.width + left * c->size_inc.width;
+    oh = c->area.height;
+    yoff = -top * c->size_inc.height;
+    nh = oh + bottom * c->size_inc.height + top * c->size_inc.height;
 
-        if (o->left_denom)
-            left = (left * c->area.width / c->size_inc.width) / o->left_denom;
-        if (o->right_denom)
-            right = (right * c->area.width / c->size_inc.width) / o->right_denom;
-        if (o->top_denom)
-            top = (top * c->area.height / c->size_inc.height) / o->top_denom;
-        if (o->bottom_denom)
-            bottom = (bottom * c->area.height / c->size_inc.height) / o->bottom_denom;
+    client_try_configure(c, &x, &y, &nw, &nh, &lw, &lh, TRUE);
+    xoff = xoff == 0 ? 0 :
+        (xoff < 0 ? MAX(xoff, ow-nw) : MIN(xoff, ow-nw));
+    yoff = yoff == 0 ? 0 :
+        (yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh));
 
-        x = c->area.x;
-        y = c->area.y;
-        ow = c->area.width;
-        xoff = -left * c->size_inc.width;
-        nw = ow + right * c->size_inc.width
-            + left * c->size_inc.width;
-        oh = c->area.height;
-        yoff = -top * c->size_inc.height;
-        nh = oh + bottom * c->size_inc.height
-            + top * c->size_inc.height;
+    client_move_resize(c, x + xoff, y + yoff, nw, nh);
 
-        client_try_configure(c, &x, &y, &nw, &nh, &lw, &lh, TRUE);
-        xoff = xoff == 0 ? 0 :
-            (xoff < 0 ? MAX(xoff, ow-nw) : MIN(xoff, ow-nw));
-        yoff = yoff == 0 ? 0 :
-            (yoff < 0 ? MAX(yoff, oh-nh) : MIN(yoff, oh-nh));
+    return TRUE;
+}
 
+/* Always return FALSE because its not interactive */
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
+{
+    if (!client_set_is_empty(set)) {
         action_client_move(data, TRUE);
-        client_move_resize(c, x + xoff, y + yoff, nw, nh);
+        client_set_run(set, data, each_run, options);
         action_client_move(data, FALSE);
     }
-
     return FALSE;
 }
index 9521e814bbb1e334d8927eb538aa87814bc8a722..3b5750f0748beba8078ee185a3d2ee75f9ed1066 100644 (file)
@@ -1,6 +1,7 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/openbox.h"
 #include "obt/paths.h"
 
@@ -10,7 +11,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_restart_startup(void)
 {
@@ -39,7 +41,8 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
 
index f97c51712a50d57d8adc775eb869c3ec6c4140c5..489891a5e416fcaa8eef1bdacb0e65f09abfd2c6 100644 (file)
@@ -1,10 +1,14 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/client.h"
+#include "openbox/client_set.h"
 
-static gboolean run_func_on(const ObActionListRun *data, gpointer options);
-static gboolean run_func_off(const ObActionListRun *data, gpointer options);
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options);
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options);
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options);
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options);
 
 void action_shade_startup(void)
 {
@@ -16,34 +20,58 @@ void action_shade_startup(void)
                     NULL, NULL, run_func_toggle);
 }
 
+static gboolean each_on(ObClient *c, const ObActionListRun *data,
+                        gpointer options)
+{
+    client_shade(c, TRUE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_on(const ObActionListRun *data, gpointer options)
+static gboolean run_func_on(const ObClientSet *set,
+                            const ObActionListRun *data, gpointer options)
 {
     if (data->target) {
         action_client_move(data, TRUE);
-        client_shade(data->target, TRUE);
+        client_set_run(set, data, each_on, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
 }
 
+static gboolean each_off(ObClient *c, const ObActionListRun *data,
+                         gpointer options)
+{
+    client_shade(c, FALSE);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_off(const ObActionListRun *data, gpointer options)
+static gboolean run_func_off(const ObClientSet *set,
+                             const ObActionListRun *data, gpointer options)
 {
     if (data->target) {
         action_client_move(data, TRUE);
-        client_shade(data->target, FALSE);
+        client_set_run(set, data, each_off, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
 }
 
+static gboolean each_toggle(ObClient *c, const ObActionListRun *data,
+                            gpointer options)
+{
+    client_shade(c, !c->shaded);
+    return TRUE;
+}
+
 /* Always return FALSE because its not interactive */
-static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
+static gboolean run_func_toggle(const ObClientSet *set,
+                                const ObActionListRun *data, gpointer options)
 {
     if (data->target) {
         action_client_move(data, TRUE);
-        client_shade(data->target, !data->target->shaded);
+        client_set_run(set, data, each_toggle, options);
         action_client_move(data, FALSE);
     }
     return FALSE;
index 3b31a955d59f72f76be96f52bed394095f531005..62af374a75e0f0586118abd2c229d81706b85bbe 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/screen.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_showdesktop_startup(void)
 {
@@ -11,7 +13,8 @@ void action_showdesktop_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     screen_show_desktop(!screen_showing_desktop, NULL);
 
index 272c7de527ef242a6eca1825059d72a507fe2f31..256751ef3b4cb193626aca58dc5793d46cef3318 100644 (file)
@@ -1,6 +1,7 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
 #include "openbox/action_value.h"
+#include "openbox/client_set.h"
 #include "openbox/menu.h"
 #include <glib.h>
 
@@ -10,7 +11,8 @@ typedef struct {
 
 static gpointer setup_func(GHashTable *config);
 static void     free_func(gpointer options);
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_showmenu_startup(void)
 {
@@ -39,14 +41,25 @@ static void free_func(gpointer options)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
     Options *o = options;
+    GList *list;
+    struct _ObClient *c;
+
+    /* this can't work on more than one window */
+    if (client_set_size(set) > 1) return FALSE;
+
+    list = client_set_get_all(set);
+    if (list) c = list->data;
+    else c = NULL;
+    g_list_free(list);
 
     /* you cannot call ShowMenu from inside a menu */
     if (data->user_act != OB_USER_ACTION_MENU_SELECTION && o->name)
         menu_show(o->name, data->pointer_x, data->pointer_y,
-                  data->pointer_button != 0, data->target);
+                  data->pointer_button != 0, c);
 
     return FALSE;
 }
index 40d7b282b3614a2de28307a6d16c700820307d9a..7ec991b68d9ed9651319b989484476fb0ca7d949 100644 (file)
@@ -1,8 +1,10 @@
 #include "openbox/action.h"
 #include "openbox/action_list_run.h"
+#include "openbox/client_set.h"
 #include "openbox/focus.h"
 
-static gboolean run_func(const ObActionListRun *data, gpointer options);
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options);
 
 void action_unfocus_startup(void)
 {
@@ -11,9 +13,10 @@ void action_unfocus_startup(void)
 }
 
 /* Always return FALSE because its not interactive */
-static gboolean run_func(const ObActionListRun *data, gpointer options)
+static gboolean run_func(const ObClientSet *set,
+                         const ObActionListRun *data, gpointer options)
 {
-    if (data->target && data->target == focus_client)
+    if (focus_client && client_set_contains(set, focus_client))
         focus_fallback(FALSE, FALSE, TRUE, FALSE);
     return FALSE;
 }
index 6d4cc2a5ea932188b4ff908e8051916b1036d6d1..5510c371961e2c4deca266e0ca738a5dc4e8d1e9 100644 (file)
@@ -20,6 +20,7 @@
 #include "focus_cycle.h"
 #include "focus_cycle_indicator.h"
 #include "client.h"
+#include "client_set.h"
 #include "frame.h"
 #include "focus.h"
 #include "screen.h"
@@ -36,16 +37,16 @@ typedef enum {
 } ObCycleType;
 
 ObClient       *focus_cycle_target = NULL;
+ObClientSet    *focus_cycle_set = NULL;
 static ObCycleType focus_cycle_type = OB_CYCLE_NONE;
 static gboolean focus_cycle_linear;
 static gboolean focus_cycle_iconic_windows;
-static gboolean focus_cycle_all_desktops;
-static gboolean focus_cycle_nonhilite_windows;
 static gboolean focus_cycle_dock_windows;
 static gboolean focus_cycle_desktop_windows;
 
 static ObClient *focus_find_directional(ObClient *c,
                                         ObDirection dir,
+                                        const ObClientSet *set,
                                         gboolean dock_windows,
                                         gboolean desktop_windows);
 
@@ -66,7 +67,8 @@ void focus_cycle_addremove(ObClient *c, gboolean redraw)
 
     if (focus_cycle_type == OB_CYCLE_DIRECTIONAL) {
         if (c && focus_cycle_target == c) {
-            focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE,
+            /* cancel it */
+            focus_directional_cycle(0, NULL, TRUE, TRUE, TRUE, TRUE,
                                     TRUE, TRUE, TRUE);
         }
     }
@@ -87,19 +89,19 @@ void focus_cycle_addremove(ObClient *c, gboolean redraw)
 void focus_cycle_reorder()
 {
     if (focus_cycle_type == OB_CYCLE_NORMAL) {
-        focus_cycle_target = focus_cycle_popup_refresh(focus_cycle_target,
+        focus_cycle_target = focus_cycle_popup_refresh(focus_cycle_set,
+                                                       focus_cycle_target,
                                                        TRUE,
                                                        focus_cycle_linear);
         focus_cycle_update_indicator(focus_cycle_target);
         if (!focus_cycle_target)
-            focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
+            focus_cycle(NULL, TRUE, TRUE, TRUE, TRUE,
                         TRUE, TRUE, OB_FOCUS_CYCLE_POPUP_MODE_NONE,
                         TRUE, TRUE);
     }
 }
 
-ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
-                      gboolean nonhilite_windows,
+ObClient* focus_cycle(const ObClientSet *set, gboolean forward,
                       gboolean dock_windows, gboolean desktop_windows,
                       gboolean linear, gboolean interactive,
                       gboolean showbar, ObFocusCyclePopupMode mode,
@@ -129,10 +131,9 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
     }
 
     if (focus_cycle_target == NULL) {
+        focus_cycle_set = client_set_clone(set);
         focus_cycle_linear = linear;
         focus_cycle_iconic_windows = TRUE;
-        focus_cycle_all_desktops = all_desktops;
-        focus_cycle_nonhilite_windows = nonhilite_windows;
         focus_cycle_dock_windows = dock_windows;
         focus_cycle_desktop_windows = desktop_windows;
         start = it = g_list_find(list, focus_client);
@@ -160,7 +161,8 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
                     focus_cycle_draw_indicator(showbar ? ft : NULL);
                 }
                 /* same arguments as focus_target_valid */
-                focus_cycle_popup_show(ft, mode, focus_cycle_linear);
+                focus_cycle_popup_show(focus_cycle_set, ft, mode,
+                                       focus_cycle_linear);
                 return focus_cycle_target;
             } else if (ft != focus_cycle_target) {
                 focus_cycle_target = ft;
@@ -175,6 +177,8 @@ done_cycle:
     if (done && !cancel) ret = focus_cycle_target;
 
     focus_cycle_target = NULL;
+    client_set_destroy(focus_cycle_set);
+    focus_cycle_set = NULL;
     focus_cycle_type = OB_CYCLE_NONE;
     g_list_free(order);
     order = NULL;
@@ -189,6 +193,7 @@ done_cycle:
 
 /* this be mostly ripped from fvwm */
 static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
+                                        const ObClientSet *set,
                                         gboolean dock_windows,
                                         gboolean desktop_windows)
 {
@@ -282,7 +287,8 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
     return best_client;
 }
 
-ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows,
+ObClient* focus_directional_cycle(ObDirection dir, const ObClientSet *set,
+                                  gboolean dock_windows,
                                   gboolean desktop_windows,
                                   gboolean interactive,
                                   gboolean showbar, gboolean dialog,
@@ -302,10 +308,9 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows,
         goto done_cycle;
 
     if (focus_cycle_target == NULL) {
+        focus_cycle_set = client_set_clone(set);
         focus_cycle_linear = FALSE;
         focus_cycle_iconic_windows = FALSE;
-        focus_cycle_all_desktops = FALSE;
-        focus_cycle_nonhilite_windows = TRUE;
         focus_cycle_dock_windows = dock_windows;
         focus_cycle_desktop_windows = desktop_windows;
     }
@@ -313,10 +318,11 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows,
     if (!first) first = focus_client;
 
     if (focus_cycle_target)
-        ft = focus_find_directional(focus_cycle_target, dir, dock_windows,
+        ft = focus_find_directional(focus_cycle_target, dir, set, dock_windows,
                                     desktop_windows);
     else if (first)
-        ft = focus_find_directional(first, dir, dock_windows, desktop_windows);
+        ft = focus_find_directional(first, dir, set, dock_windows,
+                                    desktop_windows);
     else {
         GList *it;
 
@@ -344,6 +350,8 @@ done_cycle:
 
     first = NULL;
     focus_cycle_target = NULL;
+    client_set_destroy(focus_cycle_set);
+    focus_cycle_set = NULL;
     focus_cycle_type = OB_CYCLE_NONE;
 
     focus_cycle_draw_indicator(NULL);
@@ -354,11 +362,13 @@ done_cycle:
 
 gboolean focus_cycle_valid(struct _ObClient *client)
 {
-    return focus_valid_target(client, screen_desktop, TRUE,
-                              focus_cycle_iconic_windows,
-                              focus_cycle_all_desktops,
-                              focus_cycle_nonhilite_windows,
-                              focus_cycle_dock_windows,
-                              focus_cycle_desktop_windows,
-                              FALSE);
+    return
+        client_set_contains(focus_cycle_set, client) &&
+        focus_valid_target(client, screen_desktop, TRUE,
+                           focus_cycle_iconic_windows,
+                           TRUE, /* all desktops */
+                           TRUE, /* non-hilite windows */
+                           focus_cycle_dock_windows,
+                           focus_cycle_desktop_windows,
+                           FALSE);
 }
index 9394b3df8bb65ba187b4f1e37329a942d65900b5..7e32db9d481ee35aba20ab44da97ffacf3b533de 100644 (file)
@@ -35,13 +35,15 @@ void focus_cycle_startup(gboolean reconfig);
 void focus_cycle_shutdown(gboolean reconfig);
 
 /*! Cycle focus amongst windows. */
-struct _ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
-                              gboolean nonhilite_windows,
+struct _ObClient* focus_cycle(const struct _ObClientSet *set,
+                              gboolean forward,
                               gboolean dock_windows, gboolean desktop_windows,
                               gboolean linear, gboolean interactive,
                               gboolean showbar, ObFocusCyclePopupMode mode,
                               gboolean done, gboolean cancel);
+
 struct _ObClient* focus_directional_cycle(ObDirection dir,
+                                          const struct _ObClientSet *set,
                                           gboolean dock_windows,
                                           gboolean desktop_windows,
                                           gboolean interactive,
index e1ea8488874fbc159d75f3423bf894b21505e95e..6942d4ef3d37772260efe2569c4f25c5fdf5c21b 100644 (file)
@@ -21,6 +21,7 @@
 #include "focus_cycle.h"
 #include "popup.h"
 #include "client.h"
+#include "client_set.h"
 #include "screen.h"
 #include "focus.h"
 #include "openbox.h"
@@ -101,6 +102,7 @@ static ObIconPopup *single_popup;
 
 static gchar   *popup_get_name (ObClient *c);
 static gboolean popup_setup    (ObFocusCyclePopup *p,
+                                const ObClientSet *set,
                                 gboolean create_targets,
                                 gboolean refresh_targets,
                                 gboolean linear);
@@ -250,8 +252,9 @@ static void popup_target_free(ObFocusCyclePopupTarget *t)
     g_slice_free(ObFocusCyclePopupTarget, t);
 }
 
-static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
-                            gboolean refresh_targets, gboolean linear)
+static gboolean popup_setup(ObFocusCyclePopup *p, const ObClientSet *set,
+                            gboolean create_targets, gboolean refresh_targets,
+                            gboolean linear)
 {
     gint maxwidth, n;
     GList *it;
@@ -286,7 +289,7 @@ static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets,
     {
         ObClient *ft = it->data;
 
-        if (focus_cycle_valid(ft)) {
+        if (client_set_contains(set, ft) && focus_cycle_valid(ft)) {
             GList *rit;
 
             /* reuse the target if possible during refresh */
@@ -704,8 +707,8 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c)
     XFlush(obt_display);
 }
 
-void focus_cycle_popup_show(ObClient *c, ObFocusCyclePopupMode mode,
-                            gboolean linear)
+void focus_cycle_popup_show(const ObClientSet *set, ObClient *c,
+                            ObFocusCyclePopupMode mode, gboolean linear)
 {
     g_assert(c != NULL);
 
@@ -716,7 +719,7 @@ void focus_cycle_popup_show(ObClient *c, ObFocusCyclePopupMode mode,
 
     /* do this stuff only when the dialog is first showing */
     if (!popup.mapped) {
-        popup_setup(&popup, TRUE, FALSE, linear);
+        popup_setup(&popup, set, TRUE, FALSE, linear);
         /* this is fixed once the dialog is shown */
         popup.mode = mode;
     }
@@ -822,7 +825,8 @@ static ObClient* popup_revert(ObClient *target)
     return NULL;
 }
 
-ObClient* focus_cycle_popup_refresh(ObClient *target,
+ObClient* focus_cycle_popup_refresh(const ObClientSet *set,
+                                    ObClient *target,
                                     gboolean redraw,
                                     gboolean linear)
 {
@@ -831,7 +835,7 @@ ObClient* focus_cycle_popup_refresh(ObClient *target,
     if (!focus_cycle_valid(target))
         target = popup_revert(target);
 
-    redraw = popup_setup(&popup, TRUE, TRUE, linear) && redraw;
+    redraw = popup_setup(&popup, set, TRUE, TRUE, linear) && redraw;
 
     if (!target && popup.targets)
         target = ((ObFocusCyclePopupTarget*)popup.targets->data)->client;
index 8c80bfcf2d75b65024cf63c3b80af4dc6180754e..b5bc677756b9cfc092eeb1dd8f218742cc8ada7f 100644 (file)
@@ -21,6 +21,7 @@
 #define __focus_cycle_popup_h
 
 struct _ObClient;
+struct _ObClientSet;
 
 #include <glib.h>
 
@@ -33,8 +34,9 @@ typedef enum {
 void focus_cycle_popup_startup(gboolean reconfig);
 void focus_cycle_popup_shutdown(gboolean reconfig);
 
-void focus_cycle_popup_show(struct _ObClient *c, ObFocusCyclePopupMode mode,
-                            gboolean linear);
+void focus_cycle_popup_show(const struct _ObClientSet *set,
+                            struct _ObClient *c,
+                            ObFocusCyclePopupMode mode, gboolean linear);
 void focus_cycle_popup_hide(void);
 
 void focus_cycle_popup_single_show(struct _ObClient *c);
@@ -46,7 +48,8 @@ gboolean focus_cycle_popup_is_showing(struct _ObClient *c);
     the target given to the function is no longer valid, this will return
     a different target that is valid, and which should be considered the
     current focus cycling target. */
-struct _ObClient *focus_cycle_popup_refresh(struct _ObClient *target,
+struct _ObClient *focus_cycle_popup_refresh(const struct _ObClientSet *set,
+                                            struct _ObClient *target,
                                             gboolean redraw,
                                             gboolean linear);