|
|
@ -25,6 +25,15 @@ static void unmanaged_handle_request_configure(struct wl_listener *listener,
|
|
|
|
ev->width, ev->height);
|
|
|
|
ev->width, ev->height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void unmanaged_handle_request_fullscreen(struct wl_listener *listener,
|
|
|
|
|
|
|
|
void *data) {
|
|
|
|
|
|
|
|
struct sway_xwayland_view *xwayland_view =
|
|
|
|
|
|
|
|
wl_container_of(listener, xwayland_view, request_fullscreen);
|
|
|
|
|
|
|
|
struct sway_view *view = &xwayland_view->view;
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
|
|
|
|
|
|
|
view_set_fullscreen(view, xsurface->fullscreen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
|
|
|
|
static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
|
|
|
|
struct sway_xwayland_unmanaged *surface =
|
|
|
|
struct sway_xwayland_unmanaged *surface =
|
|
|
|
wl_container_of(listener, surface, commit);
|
|
|
|
wl_container_of(listener, surface, commit);
|
|
|
@ -106,6 +115,9 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
|
|
|
|
wl_signal_add(&xsurface->events.request_configure,
|
|
|
|
wl_signal_add(&xsurface->events.request_configure,
|
|
|
|
&surface->request_configure);
|
|
|
|
&surface->request_configure);
|
|
|
|
surface->request_configure.notify = unmanaged_handle_request_configure;
|
|
|
|
surface->request_configure.notify = unmanaged_handle_request_configure;
|
|
|
|
|
|
|
|
wl_signal_add(&xsurface->events.request_fullscreen,
|
|
|
|
|
|
|
|
&surface->request_fullscreen);
|
|
|
|
|
|
|
|
surface->request_fullscreen.notify = unmanaged_handle_request_fullscreen;
|
|
|
|
wl_signal_add(&xsurface->events.map, &surface->map);
|
|
|
|
wl_signal_add(&xsurface->events.map, &surface->map);
|
|
|
|
surface->map.notify = unmanaged_handle_map;
|
|
|
|
surface->map.notify = unmanaged_handle_map;
|
|
|
|
wl_signal_add(&xsurface->events.unmap, &surface->unmap);
|
|
|
|
wl_signal_add(&xsurface->events.unmap, &surface->unmap);
|
|
|
@ -179,6 +191,14 @@ static void set_activated(struct sway_view *view, bool activated) {
|
|
|
|
wlr_xwayland_surface_activate(surface, activated);
|
|
|
|
wlr_xwayland_surface_activate(surface, activated);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
|
|
|
|
|
|
|
|
if (xwayland_view_from_view(view) == NULL) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *surface = view->wlr_xwayland_surface;
|
|
|
|
|
|
|
|
wlr_xwayland_surface_set_fullscreen(surface, fullscreen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void _close(struct sway_view *view) {
|
|
|
|
static void _close(struct sway_view *view) {
|
|
|
|
if (xwayland_view_from_view(view) == NULL) {
|
|
|
|
if (xwayland_view_from_view(view) == NULL) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -193,6 +213,7 @@ static void destroy(struct sway_view *view) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wl_list_remove(&xwayland_view->destroy.link);
|
|
|
|
wl_list_remove(&xwayland_view->destroy.link);
|
|
|
|
wl_list_remove(&xwayland_view->request_configure.link);
|
|
|
|
wl_list_remove(&xwayland_view->request_configure.link);
|
|
|
|
|
|
|
|
wl_list_remove(&xwayland_view->request_fullscreen.link);
|
|
|
|
wl_list_remove(&xwayland_view->map.link);
|
|
|
|
wl_list_remove(&xwayland_view->map.link);
|
|
|
|
wl_list_remove(&xwayland_view->unmap.link);
|
|
|
|
wl_list_remove(&xwayland_view->unmap.link);
|
|
|
|
free(xwayland_view);
|
|
|
|
free(xwayland_view);
|
|
|
@ -202,6 +223,7 @@ static const struct sway_view_impl view_impl = {
|
|
|
|
.get_prop = get_prop,
|
|
|
|
.get_prop = get_prop,
|
|
|
|
.configure = configure,
|
|
|
|
.configure = configure,
|
|
|
|
.set_activated = set_activated,
|
|
|
|
.set_activated = set_activated,
|
|
|
|
|
|
|
|
.set_fullscreen = set_fullscreen,
|
|
|
|
.close = _close,
|
|
|
|
.close = _close,
|
|
|
|
.destroy = destroy,
|
|
|
|
.destroy = destroy,
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -263,6 +285,14 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
|
|
|
|
ev->width, ev->height);
|
|
|
|
ev->width, ev->height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void handle_request_fullscreen(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
struct sway_xwayland_view *xwayland_view =
|
|
|
|
|
|
|
|
wl_container_of(listener, xwayland_view, request_fullscreen);
|
|
|
|
|
|
|
|
struct sway_view *view = &xwayland_view->view;
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
|
|
|
|
|
|
|
view_set_fullscreen(view, xsurface->fullscreen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
struct sway_server *server = wl_container_of(listener, server,
|
|
|
|
struct sway_server *server = wl_container_of(listener, server,
|
|
|
|
xwayland_surface);
|
|
|
|
xwayland_surface);
|
|
|
@ -298,6 +328,10 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
|
|
|
&xwayland_view->request_configure);
|
|
|
|
&xwayland_view->request_configure);
|
|
|
|
xwayland_view->request_configure.notify = handle_request_configure;
|
|
|
|
xwayland_view->request_configure.notify = handle_request_configure;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_add(&xsurface->events.request_fullscreen,
|
|
|
|
|
|
|
|
&xwayland_view->request_fullscreen);
|
|
|
|
|
|
|
|
xwayland_view->request_fullscreen.notify = handle_request_fullscreen;
|
|
|
|
|
|
|
|
|
|
|
|
wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap);
|
|
|
|
wl_signal_add(&xsurface->events.unmap, &xwayland_view->unmap);
|
|
|
|
xwayland_view->unmap.notify = handle_unmap;
|
|
|
|
xwayland_view->unmap.notify = handle_unmap;
|
|
|
|
|
|
|
|
|
|
|
|