From ec5beeb8b8eec615f74f640f84e8fa8e451ba3bb Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 27 Oct 2017 19:09:38 +0200 Subject: Move xcursor stuff into its own file --- include/rootston/input.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/rootston/input.h') diff --git a/include/rootston/input.h b/include/rootston/input.h index 33750d7b..9c80be61 100644 --- a/include/rootston/input.h +++ b/include/rootston/input.h @@ -88,8 +88,7 @@ struct roots_input { // TODO: multiseat, multicursor struct wlr_cursor *cursor; - struct wlr_xcursor_theme *theme; - struct wlr_xcursor *xcursor; + struct wlr_xcursor_theme *xcursor_theme; struct wlr_seat *wl_seat; struct wl_list drag_icons; struct wl_client *cursor_client; @@ -158,6 +157,12 @@ void view_begin_move(struct roots_input *input, struct wlr_cursor *cursor, void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor, struct roots_view *view, uint32_t edges); +struct wlr_xcursor *get_default_xcursor(struct wlr_xcursor_theme *theme); +struct wlr_xcursor *get_move_xcursor(struct wlr_xcursor_theme *theme); +struct wlr_xcursor *get_resize_xcursor(struct wlr_xcursor_theme *theme, + uint32_t edges); +struct wlr_xcursor *get_rotate_xcursor(struct wlr_xcursor_theme *theme); + void set_view_focus(struct roots_input *input, struct roots_desktop *desktop, struct roots_view *view); -- cgit v1.2.3 From 315c01ba0fc8567ca0320be2d3f28b26faebe607 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 27 Oct 2017 19:21:26 +0200 Subject: Remove input.last_active_view --- include/rootston/input.h | 2 +- rootston/cursor.c | 1 - rootston/desktop.c | 3 --- rootston/keyboard.c | 6 ++++-- 4 files changed, 5 insertions(+), 7 deletions(-) (limited to 'include/rootston/input.h') diff --git a/include/rootston/input.h b/include/rootston/input.h index 33750d7b..f6d75bf6 100644 --- a/include/rootston/input.h +++ b/include/rootston/input.h @@ -95,7 +95,7 @@ struct roots_input { struct wl_client *cursor_client; enum roots_cursor_mode mode; - struct roots_view *active_view, *last_active_view; + struct roots_view *active_view; int offs_x, offs_y; int view_x, view_y, view_width, view_height; float view_rotation; diff --git a/rootston/cursor.c b/rootston/cursor.c index 7d2548eb..bac8b6e7 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -172,7 +172,6 @@ void set_view_focus(struct roots_input *input, struct roots_desktop *desktop, if (!view) { return; } - input->last_active_view = view; size_t index = 0; for (size_t i = 0; i < desktop->views->length; ++i) { diff --git a/rootston/desktop.c b/rootston/desktop.c index df92f0ba..a1d8a632 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -24,9 +24,6 @@ void view_destroy(struct roots_view *view) { input->active_view = NULL; input->mode = ROOTS_CURSOR_PASSTHROUGH; } - if (input->last_active_view == view) { - input->last_active_view = NULL; - } for (size_t i = 0; i < desktop->views->length; ++i) { struct roots_view *_view = desktop->views->items[i]; diff --git a/rootston/keyboard.c b/rootston/keyboard.c index 142e9c71..c91c326b 100644 --- a/rootston/keyboard.c +++ b/rootston/keyboard.c @@ -29,8 +29,10 @@ static void keyboard_binding_execute(struct roots_keyboard *keyboard, if (strcmp(command, "exit") == 0) { wl_display_terminate(server->wl_display); } else if (strcmp(command, "close") == 0) { - if (keyboard->input->last_active_view != NULL) { - view_close(keyboard->input->last_active_view); + if (server->desktop->views->length > 0) { + struct roots_view *view = + server->desktop->views->items[server->desktop->views->length-1]; + view_close(view); } } else if (strcmp(command, "next_window") == 0) { if (server->desktop->views->length > 0) { -- cgit v1.2.3