diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-11 18:24:12 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2013-03-11 18:24:12 +0100 |
commit | f2debeca660f02eee551645c7997915142463cac (patch) | |
tree | a77e070da03eddb2df80c1cf7c76142c0f3f80d9 | |
parent | b52f3800c2b83ea2f6e48d15a8f154f7dd3530ad (diff) | |
download | mpv-f2debeca660f02eee551645c7997915142463cac.tar.bz2 mpv-f2debeca660f02eee551645c7997915142463cac.tar.xz |
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.
-rw-r--r-- | video/out/wayland_common.c | 8 |
1 files changed, 8 insertions, 0 deletions
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, |