wlr_wl_shell: implement all requests except set_popup

This commit is contained in:
emersion 2017-09-27 21:15:31 +02:00
parent e001e40022
commit 663bfe4cd8
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 262 additions and 40 deletions

View file

@ -10,17 +10,30 @@
#include "rootston/server.h"
#include "rootston/input.h"
static void handle_destroy(struct wl_listener *listener, void *data) {
struct roots_wl_shell_surface *roots_surface =
wl_container_of(listener, roots_surface, destroy);
wl_list_remove(&roots_surface->destroy.link);
wl_list_remove(&roots_surface->ping_timeout.link);
view_destroy(roots_surface->view);
free(roots_surface);
}
void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
struct roots_desktop *desktop =
wl_container_of(listener, desktop, wl_shell_surface);
struct wlr_wl_shell_surface *surface = data;
wlr_log(L_DEBUG, "new wl_shell surface");
//wlr_wl_shell_surface_ping(surface);
wlr_log(L_DEBUG, "new shell surface: title=%s, class=%s",
surface->title, surface->class_);
//wlr_wl_shell_surface_ping(surface); // TODO: segfaults
struct roots_wl_shell_surface *roots_surface =
calloc(1, sizeof(struct roots_wl_shell_surface));
// TODO: all of the trimmings
wl_list_init(&roots_surface->destroy.link);
roots_surface->destroy.notify = handle_destroy;
wl_list_init(&roots_surface->ping_timeout.link);
struct roots_view *view = calloc(1, sizeof(struct roots_view));
view->type = ROOTS_WL_SHELL_VIEW;