]> Dogcows Code - chaz/openbox/commitdiff
split up the relative move/resize actions into horz/vert
authorDana Jansens <danakj@orodu.net>
Wed, 26 Mar 2003 13:13:45 +0000 (13:13 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 26 Mar 2003 13:13:45 +0000 (13:13 +0000)
openbox/action.c
openbox/action.h

index 4cd751071037ded7b412df70d8d545a1bb44419e..ce96ad41e144dc08b525985a1288aa7452d6e8ff 100644 (file)
@@ -60,10 +60,14 @@ Action *action_from_string(char *name)
         a = action_new(action_toggle_shade);
     } else if (!g_ascii_strcasecmp(name, "toggleomnipresent")) {
         a = action_new(action_toggle_omnipresent);
-    } else if (!g_ascii_strcasecmp(name, "moverelative")) {
-        a = action_new(action_move_relative);
-    } else if (!g_ascii_strcasecmp(name, "resizerelative")) {
-        a = action_new(action_resize_relative);
+    } else if (!g_ascii_strcasecmp(name, "moverelativehorz")) {
+        a = action_new(action_move_relative_horz);
+    } else if (!g_ascii_strcasecmp(name, "moverelativevert")) {
+        a = action_new(action_move_relative_vert);
+    } else if (!g_ascii_strcasecmp(name, "resizerelativehorz")) {
+        a = action_new(action_resize_relative_horz);
+    } else if (!g_ascii_strcasecmp(name, "resizerelativevert")) {
+        a = action_new(action_resize_relative_vert);
     } else if (!g_ascii_strcasecmp(name, "maximizefull")) {
         a = action_new(action_maximize_full);
     } else if (!g_ascii_strcasecmp(name, "unmaximizefull")) {
@@ -234,23 +238,40 @@ void action_toggle_omnipresent(union ActionData *data)
                            screen_desktop : DESKTOP_ALL);
 }
 
-void action_move_relative(union ActionData *data)
+void action_move_relative_horz(union ActionData *data)
 {
     Client *c = data->relative.c;
     if (c)
         client_configure(c, Corner_TopLeft,
-                         c->area.x + data->relative.dx,
-                         c->area.y + data->relative.dy,
+                         c->area.x + data->relative.delta, c->area.y,
                          c->area.width, c->area.height, TRUE, TRUE);
 }
 
-void action_resize_relative(union ActionData *data)
+void action_move_relative_vert(union ActionData *data)
+{
+    Client *c = data->relative.c;
+    if (c)
+        client_configure(c, Corner_TopLeft,
+                         c->area.x, c->area.y + data->relative.delta,
+                         c->area.width, c->area.height, TRUE, TRUE);
+}
+
+void action_resize_relative_horz(union ActionData *data)
+{
+    Client *c = data->relative.c;
+    if (c)
+        client_configure(c, Corner_TopLeft, c->area.x, c->area.y,
+                         c->area.width + data->relative.delta,
+                         c->area.height, TRUE, TRUE);
+}
+
+void action_resize_relative_vert(union ActionData *data)
 {
     Client *c = data->relative.c;
     if (c)
         client_configure(c, Corner_TopLeft, c->area.x, c->area.y,
-                         c->area.width + data->relative.dx,
-                         c->area.height + data->relative.dy, TRUE, TRUE);
+                         c->area.width, c->area.height + data->relative.delta,
+                         TRUE, TRUE);
 }
 
 void action_maximize_full(union ActionData *data)
index e3d891f0a740d97f95fa6708dfe14e417d35cd64..672ee6c42b1f78c9e9e1bb253d2553641c033f10 100644 (file)
@@ -23,8 +23,7 @@ struct ClientAction {
 
 struct MoveResizeRelative {
     Client *c;
-    int dx;
-    int dy;
+    int delta;
 };
 
 struct SendToDesktop {
@@ -123,9 +122,13 @@ void action_toggle_shade(union ActionData *data);
 /* ClientAction */
 void action_toggle_omnipresent(union ActionData *data);
 /* MoveResizeRelative */
-void action_move_relative(union ActionData *data);
+void action_move_relative_horz(union ActionData *data);
 /* MoveResizeRelative */
-void action_resize_relative(union ActionData *data);
+void action_move_relative_vert(union ActionData *data);
+/* MoveResizeRelative */
+void action_resize_relative_horz(union ActionData *data);
+/* MoveResizeRelative */
+void action_resize_relative_vert(union ActionData *data);
 /* ClientAction */
 void action_maximize_full(union ActionData *data);
 /* ClientAction */
This page took 0.028258 seconds and 4 git commands to generate.