|
|
@ -9,6 +9,13 @@
|
|
|
|
#include "rootston/desktop.h"
|
|
|
|
#include "rootston/desktop.h"
|
|
|
|
#include "rootston/server.h"
|
|
|
|
#include "rootston/server.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
|
|
|
|
|
|
|
|
assert(view->type == ROOTS_XWAYLAND_VIEW);
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface;
|
|
|
|
|
|
|
|
wlr_xwayland_surface_configure(view->desktop->xwayland, xwayland_surface,
|
|
|
|
|
|
|
|
xwayland_surface->x, xwayland_surface->y, width, height);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
@ -24,16 +31,11 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
|
|
|
|
roots_surface->view->xwayland_surface;
|
|
|
|
roots_surface->view->xwayland_surface;
|
|
|
|
struct wlr_xwayland_surface_configure_event *event = data;
|
|
|
|
struct wlr_xwayland_surface_configure_event *event = data;
|
|
|
|
|
|
|
|
|
|
|
|
xwayland_surface->x = event->x;
|
|
|
|
|
|
|
|
xwayland_surface->y = event->y;
|
|
|
|
|
|
|
|
xwayland_surface->width = event->width;
|
|
|
|
|
|
|
|
xwayland_surface->height = event->height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
roots_surface->view->x = (double)event->x;
|
|
|
|
roots_surface->view->x = (double)event->x;
|
|
|
|
roots_surface->view->y = (double)event->y;
|
|
|
|
roots_surface->view->y = (double)event->y;
|
|
|
|
|
|
|
|
|
|
|
|
wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland,
|
|
|
|
wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland,
|
|
|
|
xwayland_surface);
|
|
|
|
xwayland_surface, event->x, event->y, event->width, event->height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void activate(struct roots_view *view, bool active) {
|
|
|
|
static void activate(struct roots_view *view, bool active) {
|
|
|
@ -75,6 +77,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|
view->wlr_surface = surface->surface;
|
|
|
|
view->desktop = desktop;
|
|
|
|
view->desktop = desktop;
|
|
|
|
view->activate = activate;
|
|
|
|
view->activate = activate;
|
|
|
|
|
|
|
|
view->resize = resize;
|
|
|
|
roots_surface->view = view;
|
|
|
|
roots_surface->view = view;
|
|
|
|
list_add(desktop->views, view);
|
|
|
|
list_add(desktop->views, view);
|
|
|
|
}
|
|
|
|
}
|
|
|
|