From 09b817deaa8f2f8b230f945ef1701210edc8e3ac Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Mon, 30 Dec 2019 21:44:29 -0700 Subject: [PATCH] Remove focus on click It's a config responsibility now. --- kiwmi/input/cursor.c | 16 ---------------- kiwmi/luak.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/kiwmi/input/cursor.c b/kiwmi/input/cursor.c index 0046e61..048656d 100644 --- a/kiwmi/input/cursor.c +++ b/kiwmi/input/cursor.c @@ -92,22 +92,6 @@ cursor_button_notify(struct wl_listener *listener, void *data) wlr_seat_pointer_notify_button( input->seat, event->time_msec, event->button, event->state); - - double sx; - double sy; - struct wlr_surface *surface; - - struct kiwmi_view *view = view_at( - &server->desktop, - cursor->cursor->x, - cursor->cursor->y, - &surface, - &sx, - &sy); - - if (event->state == WLR_BUTTON_PRESSED) { - focus_view(view); - } } static void diff --git a/kiwmi/luak.c b/kiwmi/luak.c index d346322..4d12886 100644 --- a/kiwmi/luak.c +++ b/kiwmi/luak.c @@ -87,8 +87,20 @@ l_kiwmi_view_close(lua_State *L) return 0; } +static int +l_kiwmi_view_focus(lua_State *L) +{ + struct kiwmi_view *view = + *(struct kiwmi_view **)luaL_checkudata(L, 1, "kiwmi_view"); + + focus_view(view); + + return 0; +} + static const luaL_Reg kiwmi_view_methods[] = { {"close", l_kiwmi_view_close}, + {"focus", l_kiwmi_view_focus}, {NULL, NULL}, };