|
|
@ -95,7 +95,6 @@ static void maximize(struct roots_view *view, bool maximized) {
|
|
|
|
static void handle_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_destroy(struct wl_listener *listener, void *data) {
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
wl_container_of(listener, roots_surface, destroy);
|
|
|
|
wl_container_of(listener, roots_surface, destroy);
|
|
|
|
view_teardown(roots_surface->view);
|
|
|
|
|
|
|
|
wl_list_remove(&roots_surface->destroy.link);
|
|
|
|
wl_list_remove(&roots_surface->destroy.link);
|
|
|
|
wl_list_remove(&roots_surface->request_configure.link);
|
|
|
|
wl_list_remove(&roots_surface->request_configure.link);
|
|
|
|
wl_list_remove(&roots_surface->request_move.link);
|
|
|
|
wl_list_remove(&roots_surface->request_move.link);
|
|
|
@ -174,29 +173,24 @@ static void handle_request_maximize(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_map_notify(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_map_notify(struct wl_listener *listener, void *data) {
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
wl_container_of(listener, roots_surface, map_notify);
|
|
|
|
wl_container_of(listener, roots_surface, map_notify);
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *xsurface = data;
|
|
|
|
struct roots_view *view = roots_surface->view;
|
|
|
|
struct roots_view *view = roots_surface->view;
|
|
|
|
struct wlr_xwayland_surface *xsurface = view->xwayland_surface;
|
|
|
|
//struct roots_desktop *desktop = view->desktop;
|
|
|
|
struct roots_desktop *desktop = view->desktop;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view->wlr_surface = xsurface->surface;
|
|
|
|
view->wlr_surface = xsurface->surface;
|
|
|
|
view->x = (double)xsurface->x;
|
|
|
|
view->x = (double)xsurface->x;
|
|
|
|
view->y = (double)xsurface->y;
|
|
|
|
view->y = (double)xsurface->y;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_list_push(desktop->views, roots_surface->view);
|
|
|
|
// TODO: add view to desktop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_unmap_notify(struct wl_listener *listener, void *data) {
|
|
|
|
static void handle_unmap_notify(struct wl_listener *listener, void *data) {
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
struct roots_xwayland_surface *roots_surface =
|
|
|
|
wl_container_of(listener, roots_surface, unmap_notify);
|
|
|
|
wl_container_of(listener, roots_surface, unmap_notify);
|
|
|
|
struct roots_desktop *desktop = roots_surface->view->desktop;
|
|
|
|
//struct roots_desktop *desktop = roots_surface->view->desktop;
|
|
|
|
roots_surface->view->wlr_surface = NULL;
|
|
|
|
roots_surface->view->wlr_surface = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < desktop->views->length; i++) {
|
|
|
|
// TODO: remove view from desktop
|
|
|
|
if (desktop->views->items[i] == roots_surface->view) {
|
|
|
|
|
|
|
|
wlr_list_del(desktop->views, i);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
@ -242,7 +236,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
view->xwayland_surface = surface;
|
|
|
|
view->xwayland_surface = surface;
|
|
|
|
view->roots_xwayland_surface = roots_surface;
|
|
|
|
view->roots_xwayland_surface = roots_surface;
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|
view->desktop = desktop;
|
|
|
|
|
|
|
|
view->activate = activate;
|
|
|
|
view->activate = activate;
|
|
|
|
view->resize = resize;
|
|
|
|
view->resize = resize;
|
|
|
|
view->move = move;
|
|
|
|
view->move = move;
|
|
|
@ -250,7 +243,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
view->maximize = maximize;
|
|
|
|
view->maximize = maximize;
|
|
|
|
view->close = close;
|
|
|
|
view->close = close;
|
|
|
|
roots_surface->view = view;
|
|
|
|
roots_surface->view = view;
|
|
|
|
wlr_list_add(desktop->views, view);
|
|
|
|
view_init(view, desktop);
|
|
|
|
|
|
|
|
|
|
|
|
if (!surface->override_redirect) {
|
|
|
|
if (!surface->override_redirect) {
|
|
|
|
view_setup(view);
|
|
|
|
view_setup(view);
|
|
|
|