]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
add a reconfigure action, also reconfigure on SIGUSR2.
[chaz/openbox] / openbox / action.c
index 6e750d6f54f059e166ea519c5feb4b04a55a327e..b4ec216b118f64678b26dbd6c3cb32458c2767d3 100644 (file)
@@ -9,6 +9,7 @@
 #include "screen.h"
 #include "action.h"
 #include "openbox.h"
+#include "grab.h"
 
 #include <glib.h>
 
@@ -599,6 +600,11 @@ ActionString actionstrings[] =
         action_desktop_last,
         NULL
     },
+    {
+        "reconfigure",
+        action_reconfigure,
+        NULL
+    },
     {
         "restart",
         action_restart,
@@ -699,11 +705,6 @@ ActionString actionstrings[] =
         action_growtoedge,
         setup_action_growtoedge_east
     },
-    {
-        "vibrate",
-        action_vibrate,
-        NULL
-    },
     {
         NULL,
         NULL,
@@ -723,6 +724,9 @@ ObAction *action_from_string(char *name)
                 actionstrings[i].setup(a);
             break;
         }
+    if (!a)
+        g_warning("Invalid action '%s' requested. No such action exists.",
+                  name);
     return a;
 }
 
@@ -921,32 +925,44 @@ void action_toggle_omnipresent(union ActionData *data)
 void action_move_relative_horz(union ActionData *data)
 {
     ObClient *c = data->relative.any.c;
-    if (c)
+    if (c) {
+        grab_pointer(TRUE, None);
         client_move(c, c->area.x + data->relative.delta, c->area.y);
+        grab_pointer(FALSE, None);
+    }
 }
 
 void action_move_relative_vert(union ActionData *data)
 {
     ObClient *c = data->relative.any.c;
-    if (c)
+    if (c) {
+        grab_pointer(TRUE, None);
         client_move(c, c->area.x, c->area.y + data->relative.delta);
+        grab_pointer(FALSE, None);
+    }
 }
 
 void action_resize_relative_horz(union ActionData *data)
 {
     ObClient *c = data->relative.any.c;
-    if (c)
+    if (c) {
+        grab_pointer(TRUE, None);
         client_resize(c,
                       c->area.width + data->relative.delta * c->size_inc.width,
                       c->area.height);
+        grab_pointer(FALSE, None);
+    }
 }
 
 void action_resize_relative_vert(union ActionData *data)
 {
     ObClient *c = data->relative.any.c;
-    if (c && !c->shaded)
+    if (c && !c->shaded) {
+        grab_pointer(TRUE, None);
         client_resize(c, c->area.width, c->area.height +
                       data->relative.delta * c->size_inc.height);
+        grab_pointer(FALSE, None);
+    }
 }
 
 void action_maximize_full(union ActionData *data)
@@ -1083,6 +1099,11 @@ void action_moveresize(union ActionData *data)
                      data->moveresize.button, data->moveresize.corner);
 }
 
+void action_reconfigure(union ActionData *data)
+{
+    ob_reconfigure();
+}
+
 void action_restart(union ActionData *data)
 {
     ob_restart_other(data->execute.path);
@@ -1145,7 +1166,9 @@ void action_movetoedge(union ActionData *data)
         g_assert_not_reached();
     }
     frame_frame_gravity(c->frame, &x, &y);
+    grab_pointer(TRUE, None);
     client_move(c, x, y);
+    grab_pointer(FALSE, None);
 
 }
 
@@ -1208,7 +1231,9 @@ void action_growtoedge(union ActionData *data)
     frame_frame_gravity(c->frame, &x, &y);
     width -= c->frame->size.left + c->frame->size.right;
     height -= c->frame->size.top + c->frame->size.bottom;
-    client_move(c, x, y);
+    grab_pointer(TRUE, None);
+    client_move_resize(c, x, y, width, height);
+    grab_pointer(FALSE, None);
 }
 
 void action_send_to_layer(union ActionData *data)
@@ -1243,28 +1268,3 @@ void action_unshow_desktop(union ActionData *data)
 {
     screen_show_desktop(FALSE);
 }
-
-void action_vibrate(union ActionData *data)
-{
-    ObClient *c = data->client.any.c;
-    gint x, y, thr, length, i;
-
-    if (!c) return;
-
-    x = c->frame->area.x;
-    y = c->frame->area.y;
-    thr = 120;
-    length = y + thr;
-    for (i = 0; i < 5; ++i) {
-        while (y < length) {
-            client_move(c, x, y);
-            y += 4;
-            x -= 1;
-        }
-        while (y >= length - thr) {
-            client_move(c, x, y);
-            y -= 4;
-            x += 1;
-        }
-    }
-}
This page took 0.024802 seconds and 4 git commands to generate.