mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Focus last view on close in rootston
This commit is contained in:
parent
70cc87078e
commit
7c85709de1
5 changed files with 22 additions and 6 deletions
|
|
@ -107,14 +107,26 @@ bool view_center(struct roots_view *view) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void view_initialize(struct roots_view *view) {
|
||||
void view_setup(struct roots_view *view) {
|
||||
view_center(view);
|
||||
struct roots_input *input = view->desktop->server->input;
|
||||
|
||||
struct roots_input *input = view->desktop->server->input;
|
||||
set_view_focus(input, view->desktop, view);
|
||||
wlr_seat_keyboard_notify_enter(input->wl_seat, view->wlr_surface);
|
||||
}
|
||||
|
||||
void view_teardown(struct roots_view *view) {
|
||||
struct wlr_list *views = view->desktop->views;
|
||||
if (views->length < 2 || views->items[views->length-1] != view) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct roots_view *prev_view = views->items[views->length-2];
|
||||
struct roots_input *input = prev_view->desktop->server->input;
|
||||
set_view_focus(input, prev_view->desktop, prev_view);
|
||||
wlr_seat_keyboard_notify_enter(input->wl_seat, prev_view->wlr_surface);
|
||||
}
|
||||
|
||||
struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
||||
struct wlr_surface **surface, double *sx, double *sy) {
|
||||
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue