add support for net_moveresize_window and net_wm_moveresize

This commit is contained in:
Dana Jansens 2003-04-17 05:43:41 +00:00
parent 7e8cdf1ab7
commit 12d4c8666c
4 changed files with 76 additions and 8 deletions

View 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 */

View 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");

View 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;

View 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;
*/