|
|
@ -67,6 +67,17 @@ static void handle_request_resize(struct wl_listener *listener, void *data) {
|
|
|
|
view_begin_resize(input, event->cursor, view, e->edges);
|
|
|
|
view_begin_resize(input, event->cursor, view, e->edges);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_commit(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
struct roots_xdg_surface_v6 *roots_xdg_surface =
|
|
|
|
|
|
|
|
wl_container_of(listener, roots_xdg_surface, commit);
|
|
|
|
|
|
|
|
struct roots_view *view = roots_xdg_surface->view;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool centered = view_center(view);
|
|
|
|
|
|
|
|
if (centered) {
|
|
|
|
|
|
|
|
wl_list_remove(&listener->link);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
struct roots_xdg_surface_v6 *roots_xdg_surface =
|
|
|
|
struct roots_xdg_surface_v6 *roots_xdg_surface =
|
|
|
|
wl_container_of(listener, roots_xdg_surface, destroy);
|
|
|
|
wl_container_of(listener, roots_xdg_surface, destroy);
|
|
|
@ -98,7 +109,12 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
|
|
|
|
struct roots_xdg_surface_v6 *roots_surface =
|
|
|
|
struct roots_xdg_surface_v6 *roots_surface =
|
|
|
|
calloc(1, sizeof(struct roots_xdg_surface_v6));
|
|
|
|
calloc(1, sizeof(struct roots_xdg_surface_v6));
|
|
|
|
// TODO: all of the trimmings
|
|
|
|
if (!roots_surface) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
wl_list_init(&roots_surface->commit.link);
|
|
|
|
|
|
|
|
roots_surface->commit.notify = handle_commit;
|
|
|
|
|
|
|
|
wl_signal_add(&surface->events.commit, &roots_surface->commit);
|
|
|
|
wl_list_init(&roots_surface->destroy.link);
|
|
|
|
wl_list_init(&roots_surface->destroy.link);
|
|
|
|
roots_surface->destroy.notify = handle_destroy;
|
|
|
|
roots_surface->destroy.notify = handle_destroy;
|
|
|
|
wl_signal_add(&surface->events.destroy, &roots_surface->destroy);
|
|
|
|
wl_signal_add(&surface->events.destroy, &roots_surface->destroy);
|
|
|
@ -115,7 +131,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
|
|
|
|
struct roots_view *view = calloc(1, sizeof(struct roots_view));
|
|
|
|
struct roots_view *view = calloc(1, sizeof(struct roots_view));
|
|
|
|
view->type = ROOTS_XDG_SHELL_V6_VIEW;
|
|
|
|
view->type = ROOTS_XDG_SHELL_V6_VIEW;
|
|
|
|
view->x = view->y = 200;
|
|
|
|
|
|
|
|
view->xdg_surface_v6 = surface;
|
|
|
|
view->xdg_surface_v6 = surface;
|
|
|
|
view->roots_xdg_surface_v6 = roots_surface;
|
|
|
|
view->roots_xdg_surface_v6 = roots_surface;
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|