From f2debeca660f02eee551645c7997915142463cac Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Mon, 11 Mar 2013 18:24:12 +0100 Subject: [PATCH] wayland: move window by grabing it Because the are no server-side-decorations in the available wayland compositors use grabbing the surface to move it. --- video/out/wayland_common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index b3f6e78ccf..5aee33e048 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -382,6 +382,10 @@ static void pointer_handle_enter(void *data, display->cursor.serial = serial; display->cursor.pointer = pointer; + /* Release the left button on pointer enter again + * because after moving the shell surface no release event is sent */ + mplayer_put_key(wl->vo->key_fifo, MP_MOUSE_BTN0); + if (wl->window->type == TYPE_FULLSCREEN) hide_cursor(display); else if (display->cursor.default_cursor) { @@ -431,6 +435,10 @@ static void pointer_handle_button(void *data, mplayer_put_key(wl->vo->key_fifo, MP_MOUSE_BTN0 + (button - BTN_LEFT) | ((state == WL_POINTER_BUTTON_STATE_PRESSED) ? MP_KEY_STATE_DOWN : 0)); + + if ((button == BTN_LEFT) && (state == WL_POINTER_BUTTON_STATE_PRESSED)) + wl_shell_surface_move(wl->window->shell_surface, wl->input->seat, serial); + } static void pointer_handle_axis(void *data,