From: Kristian Høgsberg Date: Fri, 18 May 2012 17:47:43 +0000 (-0400) Subject: xwm: Move window on frame button click X-Git-Tag: 20120702.1049~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3701f6807f94aca8ad36e9f9a939ab466107aed4;p=profile%2Fivi%2Fweston.git xwm: Move window on frame button click --- diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c index e9a8f3a..5c4f7d4 100644 --- a/src/xserver-launcher.c +++ b/src/xserver-launcher.c @@ -1431,6 +1431,25 @@ weston_wm_handle_client_message(struct weston_wm *wm, get_atom_name(wm->conn, client_message->type)); } +static void +weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) +{ + xcb_button_press_event_t *button = (xcb_button_press_event_t *) event; + struct weston_shell_interface *shell_interface = + &wm->server->compositor->shell_interface; + struct weston_wm_window *window; + + fprintf(stderr, "XCB_BUTTON_%s (detail %d)\n", + button->response_type == XCB_BUTTON_PRESS ? + "PRESS" : "RELEASE", button->detail); + + window = hash_table_lookup(wm->window_hash, button->event); + if (button->response_type == XCB_BUTTON_PRESS && + button->detail == 1) + shell_interface->move(window->shsurf, + wm->server->compositor->seat); +} + static int weston_wm_handle_event(int fd, uint32_t mask, void *data) { @@ -1442,7 +1461,7 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data) switch (event->response_type & ~0x80) { case XCB_BUTTON_PRESS: case XCB_BUTTON_RELEASE: - fprintf(stderr, "button %d\n", event->response_type); + weston_wm_handle_button(wm, event); break; case XCB_EXPOSE: weston_wm_handle_expose(wm, event);