diff --git a/kiwmi/input/cursor.c b/kiwmi/input/cursor.c index 3825580..5754941 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 b61f388..abac2cc 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.