summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-05-18 14:31:30 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-05-18 14:31:30 -0400
commitda86af7a1588eabe9c7174910ea9a48a57960421 (patch)
tree064da99b8620319c7fe951c945cbfbab7a6f0555 /src
parent3701f6807f94aca8ad36e9f9a939ab466107aed4 (diff)
xwm: Handle _NET_WM_MOVERESIZE_MOVE client message
Diffstat (limited to 'src')
-rw-r--r--src/xserver-launcher.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c
index 5c4f7d4..dd9c252 100644
--- a/src/xserver-launcher.c
+++ b/src/xserver-launcher.c
@@ -101,6 +101,19 @@ struct motif_wm_hints {
#define MWM_TEAROFF_WINDOW (1L<<0)
+#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
+#define _NET_WM_MOVERESIZE_SIZE_TOP 1
+#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
+#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
+#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
+#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
+#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
+#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
+#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
+#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
+
struct weston_wm {
xcb_connection_t *conn;
const xcb_query_extension_reply_t *xfixes;
@@ -1426,9 +1439,27 @@ weston_wm_handle_client_message(struct weston_wm *wm,
{
xcb_client_message_event_t *client_message =
(xcb_client_message_event_t *) event;
-
- fprintf(stderr, "got client message, type: %s\n",
- get_atom_name(wm->conn, client_message->type));
+ struct weston_shell_interface *shell_interface =
+ &wm->server->compositor->shell_interface;
+ struct weston_wm_window *window;
+ struct weston_seat *seat;
+
+ window = hash_table_lookup(wm->window_hash, client_message->window);
+
+ fprintf(stderr, "XCB_CLIENT_MESSAGE (%s %d %d %d %d %d)\n",
+ get_atom_name(wm->conn, client_message->type),
+ client_message->data.data32[0],
+ client_message->data.data32[1],
+ client_message->data.data32[2],
+ client_message->data.data32[3],
+ client_message->data.data32[4]);
+
+ seat = wm->server->compositor->seat;
+ if (client_message->type == wm->atom.net_wm_moveresize &&
+ client_message->data.data32[2] == _NET_WM_MOVERESIZE_MOVE &&
+ seat->seat.pointer->button_count == 1 &&
+ seat->seat.pointer->focus == &window->surface->surface)
+ shell_interface->move(window->shsurf, seat);
}
static void