From e81d18cde85e4f94bb8ac7148f7169cf531b6f23 Mon Sep 17 00:00:00 2001 From: buffet Date: Mon, 20 Jan 2020 23:41:19 +0000 Subject: [PATCH] Add kiwmi:stop_interactive --- kiwmi/input/cursor.c | 2 -- kiwmi/luak/kiwmi_server.c | 12 ++++++++++++ lua_docs.md | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/kiwmi/input/cursor.c b/kiwmi/input/cursor.c index 5fbd5a6..7a7bf6a 100644 --- a/kiwmi/input/cursor.c +++ b/kiwmi/input/cursor.c @@ -199,8 +199,6 @@ cursor_button_notify(struct wl_listener *listener, void *data) wlr_seat_pointer_notify_button( input->seat->seat, event->time_msec, event->button, event->state); } - - cursor->cursor_mode = KIWMI_CURSOR_PASSTHROUGH; } static void diff --git a/kiwmi/luak/kiwmi_server.c b/kiwmi/luak/kiwmi_server.c index 4d6a765..feea223 100644 --- a/kiwmi/luak/kiwmi_server.c +++ b/kiwmi/luak/kiwmi_server.c @@ -98,6 +98,17 @@ l_kiwmi_server_spawn(lua_State *L) return 1; } +static int +l_kiwmi_server_stop_interactive(lua_State *L) +{ + struct kiwmi_server *server = + *(struct kiwmi_server **)luaL_checkudata(L, 1, "kiwmi_server"); + + server->input.cursor->cursor_mode = KIWMI_CURSOR_PASSTHROUGH; + + return 0; +} + static int l_kiwmi_server_view_at(lua_State *L) { @@ -136,6 +147,7 @@ static const luaL_Reg kiwmi_server_methods[] = { {"on", luaK_callback_register_dispatch}, {"quit", l_kiwmi_server_quit}, {"spawn", l_kiwmi_server_spawn}, + {"stop_interactive", l_kiwmi_server_stop_interactive}, {"view_at", l_kiwmi_server_view_at}, {NULL, NULL}, }; diff --git a/lua_docs.md b/lua_docs.md index ef2a659..ff1dd1a 100644 --- a/lua_docs.md +++ b/lua_docs.md @@ -34,6 +34,10 @@ Quit kiwmi. Spawn a new process. `command` is passed to `/bin/sh`. +#### kiwmi:stop_interactive() + +Stops an interactive move or resize. + #### kiwmi:view_at(x, y) Get the view at a specified position.