|
|
@ -107,14 +107,26 @@ bool view_center(struct roots_view *view) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void view_initialize(struct roots_view *view) {
|
|
|
|
void view_setup(struct roots_view *view) {
|
|
|
|
view_center(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);
|
|
|
|
set_view_focus(input, view->desktop, view);
|
|
|
|
wlr_seat_keyboard_notify_enter(input->wl_seat, view->wlr_surface);
|
|
|
|
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 roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
|
|
|
|
struct wlr_surface **surface, double *sx, double *sy) {
|
|
|
|
struct wlr_surface **surface, double *sx, double *sy) {
|
|
|
|
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
|
|
|
for (int i = desktop->views->length - 1; i >= 0; --i) {
|
|
|
|