]> Dogcows Code - chaz/openbox/commitdiff
add maximize action
authorDana Jansens <danakj@orodu.net>
Fri, 22 Jun 2007 14:41:45 +0000 (14:41 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 22 Jun 2007 14:41:45 +0000 (14:41 +0000)
Makefile.am
openbox/action.c
openbox/actions/all.c
openbox/actions/all.h
openbox/actions/maximize.c [new file with mode: 0644]

index 43dc878856c5ef536ba9f70612895f720cae56bf..519216675640aa3fe62d920017a4e95b69eca78c 100644 (file)
@@ -166,6 +166,7 @@ openbox_openbox_SOURCES = \
        openbox/actions/fullscreen.c \
        openbox/actions/iconify.c \
        openbox/actions/lower.c \
+       openbox/actions/maximize.c \
        openbox/actions/move.c \
        openbox/actions/raise.c \
        openbox/actions/raiselower.c \
index 50df9f28eb7f2e1079af47304740089a1acca0df..7dd9da489ee985bb0800f43a2001b01c68ff3349 100644 (file)
@@ -524,21 +524,6 @@ ActionString actionstrings[] =
         action_resize_relative,
         setup_client_action
     },
-    {
-        "maximizefull",
-        action_maximize_full,
-        setup_client_action
-    },
-    {
-        "unmaximizefull",
-        action_unmaximize_full,
-        setup_client_action
-    },
-    {
-        "togglemaximizefull",
-        action_toggle_maximize_full,
-        setup_client_action
-    },
     {
         "maximizehorz",
         action_maximize_horz,
@@ -1142,30 +1127,6 @@ void action_resize_relative(union ActionData *data)
     client_action_end(data, FALSE);
 }
 
-void action_maximize_full(union ActionData *data)
-{
-    client_action_start(data);
-    client_maximize(data->client.any.c, TRUE, 0);
-    client_action_end(data, config_focus_under_mouse);
-}
-
-void action_unmaximize_full(union ActionData *data)
-{
-    client_action_start(data);
-    client_maximize(data->client.any.c, FALSE, 0);
-    client_action_end(data, config_focus_under_mouse);
-}
-
-void action_toggle_maximize_full(union ActionData *data)
-{
-    client_action_start(data);
-    client_maximize(data->client.any.c,
-                    !(data->client.any.c->max_horz ||
-                      data->client.any.c->max_vert),
-                    0);
-    client_action_end(data, config_focus_under_mouse);
-}
-
 void action_maximize_horz(union ActionData *data)
 {
     client_action_start(data);
index a7295ac716636e1e52a1da6cb9c43c26accfc802..72813e3eefdf677787af455d849c9abea036d513 100644 (file)
@@ -20,4 +20,5 @@ void action_all_startup()
     action_unfocus_startup();
     action_iconify_startup();
     action_fullscreen_startup();
+    action_maximize_startup();
 }
index 238dc3a9907936fe19de1e475410f9729853915a..069c50a7b78b9edd47a13b0735ec29fcc13555a0 100644 (file)
@@ -21,5 +21,6 @@ void action_raiselower_startup();
 void action_unfocus_startup();
 void action_iconify_startup();
 void action_fullscreen_startup();
+void action_maximize_startup();
 
 #endif
diff --git a/openbox/actions/maximize.c b/openbox/actions/maximize.c
new file mode 100644 (file)
index 0000000..508c2d3
--- /dev/null
@@ -0,0 +1,26 @@
+#include "openbox/actions.h"
+#include "openbox/client.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+
+void action_maximize_startup()
+{
+    actions_register("Maximize",
+                     NULL, NULL,
+                     run_func,
+                     NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+    if (data->client) {
+        actions_client_move(data, TRUE);
+        client_maximize(data->client,
+                        !(data->client->max_horz || data->client->max_vert),
+                        0);
+        actions_client_move(data, FALSE);
+    }
+
+    return FALSE;
+}
This page took 0.030961 seconds and 4 git commands to generate.