Add kiwmi:stop_interactive

This commit is contained in:
buffet 2020-01-20 23:41:19 +00:00
parent e2ba6622f7
commit f961b97c56
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( wlr_seat_pointer_notify_button(
input->seat->seat, event->time_msec, event->button, event->state); input->seat->seat, event->time_msec, event->button, event->state);
} }
cursor->cursor_mode = KIWMI_CURSOR_PASSTHROUGH;
} }
static void static void

View file

@ -98,6 +98,17 @@ l_kiwmi_server_spawn(lua_State *L)
return 1; 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 static int
l_kiwmi_server_view_at(lua_State *L) l_kiwmi_server_view_at(lua_State *L)
{ {
@ -136,6 +147,7 @@ static const luaL_Reg kiwmi_server_methods[] = {
{"on", luaK_callback_register_dispatch}, {"on", luaK_callback_register_dispatch},
{"quit", l_kiwmi_server_quit}, {"quit", l_kiwmi_server_quit},
{"spawn", l_kiwmi_server_spawn}, {"spawn", l_kiwmi_server_spawn},
{"stop_interactive", l_kiwmi_server_stop_interactive},
{"view_at", l_kiwmi_server_view_at}, {"view_at", l_kiwmi_server_view_at},
{NULL, NULL}, {NULL, NULL},
}; };

View file

@ -34,6 +34,10 @@ Quit kiwmi.
Spawn a new process. Spawn a new process.
`command` is passed to `/bin/sh`. `command` is passed to `/bin/sh`.
#### kiwmi:stop_interactive()
Stops an interactive move or resize.
#### kiwmi:view_at(x, y) #### kiwmi:view_at(x, y)
Get the view at a specified position. Get the view at a specified position.