]> Dogcows Code - chaz/openbox/commitdiff
add support for net_moveresize_window and net_wm_moveresize
authorDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 05:43:41 +0000 (05:43 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 05:43:41 +0000 (05:43 +0000)
openbox/event.c
openbox/prop.c
openbox/prop.h
openbox/screen.c

index f919125532512afe5380b7c7ff71f4b50d2b77ea..f02f2506862100a623a56e5a5fde16c4a5d2d248 100644 (file)
@@ -662,7 +662,66 @@ static void event_handle_client(Client *client, XEvent *e)
                 client_shade(client, FALSE);
             client_focus(client);
             stacking_raise(client);
-       }
+       } else if (msgtype == prop_atoms.net_wm_moveresize) {
+           g_message("net_wm_moveresize for 0x%lx", client->window);
+            if ((Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_topleft ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_top ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_topright ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_right ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_right ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_bottomright ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_bottom ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_bottomleft ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_left ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_move ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_size_keyboard ||
+                (Atom)e->xclient.data.l[2] ==
+                prop_atoms.net_wm_moveresize_move_keyboard) {
+
+                moveresize_start(client, e->xclient.data.l[0],
+                                 e->xclient.data.l[1], e->xclient.data.l[2],
+                                 e->xclient.data.l[3]);
+            }
+        } else if (msgtype == prop_atoms.net_moveresize_window) {
+            int oldg = client->gravity;
+            int tmpg, x, y, w, h;
+
+            if (e->xclient.data.l[0] & 0xff)
+                tmpg = e->xclient.data.l[0] & 0xff;
+            else
+                tmpg = oldg;
+
+            if (e->xclient.data.l[0] & 1 << 8)
+                x = e->xclient.data.l[1];
+            else
+                x = client->area.x;
+            if (e->xclient.data.l[0] & 1 << 9)
+                y = e->xclient.data.l[2];
+            else
+                y = client->area.y;
+            if (e->xclient.data.l[0] & 1 << 10)
+                w = e->xclient.data.l[3];
+            else
+                w = client->area.y;
+            if (e->xclient.data.l[0] & 1 << 11)
+                h = e->xclient.data.l[4];
+            else
+                h = client->area.y;
+            client->gravity = tmpg;
+            client_configure(client, Corner_TopLeft, x, y, w, h, TRUE, TRUE);
+            client->gravity = oldg;
+        }
        break;
     case PropertyNotify:
        /* validate cuz we query stuff off the client here */
index cb432ac3d38f4a0aff6681edaac9e229dfc7543b..7117a91c95b7b4393921881b3d1aba904d253c94 100644 (file)
@@ -45,6 +45,7 @@ void prop_startup()
 
     CREATE(net_close_window, "_NET_CLOSE_WINDOW");
     CREATE(net_wm_moveresize, "_NET_WM_MOVERESIZE");
+    CREATE(net_moveresize_window, "_NET_MOVERESIZE_WINDOW");
 
     CREATE(net_wm_name, "_NET_WM_NAME");
     CREATE(net_wm_visible_name, "_NET_WM_VISIBLE_NAME");
index 2ed9f5591e717675022271ac85ee91552d3df314..06ad14370075e75c75eebc990b11bc55e1d89582 100644 (file)
@@ -49,6 +49,7 @@ typedef struct Atoms {
     /* root window messages */
     Atom net_close_window;
     Atom net_wm_moveresize;
+    Atom net_moveresize_window;
     /* application window properties */
     Atom net_wm_name;
     Atom net_wm_visible_name;
index 299bb684f75e83a416531381357710e53c2b70c6..118798e8e8b02f00a8a3b61c30b37a0b6e84948a 100644 (file)
@@ -78,7 +78,7 @@ gboolean screen_annex()
     PROP_SET32(support_window, net_supporting_wm_check, window,support_window);
 
     /* set the _NET_SUPPORTED_ATOMS hint */
-    num_support = 48;
+    num_support = 61;
     i = 0;
     supported = g_new(guint32, num_support);
     supported[i++] = prop_atoms.net_current_desktop;
@@ -129,14 +129,21 @@ gboolean screen_annex()
     supported[i++] = prop_atoms.net_wm_state_fullscreen;
     supported[i++] = prop_atoms.net_wm_state_above;
     supported[i++] = prop_atoms.net_wm_state_below;
+    supported[i++] = prop_atoms.net_moveresize_window;
+    supported[i++] = prop_atoms.net_wm_moveresize;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_topleft;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_top;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_topright;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_right;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_bottomright;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_bottom;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_bottomleft;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_left;
+    supported[i++] = prop_atoms.net_wm_moveresize_move;
+    supported[i++] = prop_atoms.net_wm_moveresize_size_keyboard;
+    supported[i++] = prop_atoms.net_wm_moveresize_move_keyboard;
     g_assert(i == num_support);
 /*
-  supported[] = prop_atoms.net_wm_moveresize;
-  supported[] = prop_atoms.net_wm_moveresize_size_topleft;
-  supported[] = prop_atoms.net_wm_moveresize_size_topright;
-  supported[] = prop_atoms.net_wm_moveresize_size_bottomleft;
-  supported[] = prop_atoms.net_wm_moveresize_size_bottomright;
-  supported[] = prop_atoms.net_wm_moveresize_move;
   supported[] = prop_atoms.net_wm_action_stick;
 */
 
This page took 0.029934 seconds and 4 git commands to generate.