Add kiwmi:stop_interactive

This commit is contained in:
buffet 2020-01-20 23:41:19 +00:00
parent e298ad6f44
commit e81d18cde8
3 changed files with 16 additions and 2 deletions

View file

@ -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

View file

@ -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},
};

View file

@ -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.