|
|
@ -694,6 +694,36 @@ void view_child_destroy(struct sway_view_child *child) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) {
|
|
|
|
|
|
|
|
if (wlr_surface_is_xdg_surface(wlr_surface)) {
|
|
|
|
|
|
|
|
struct wlr_xdg_surface *xdg_surface =
|
|
|
|
|
|
|
|
wlr_xdg_surface_from_wlr_surface(wlr_surface);
|
|
|
|
|
|
|
|
return view_from_wlr_xdg_surface(xdg_surface);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wlr_surface_is_xdg_surface_v6(wlr_surface)) {
|
|
|
|
|
|
|
|
struct wlr_xdg_surface_v6 *xdg_surface_v6 =
|
|
|
|
|
|
|
|
wlr_xdg_surface_v6_from_wlr_surface(wlr_surface);
|
|
|
|
|
|
|
|
return view_from_wlr_xdg_surface_v6(xdg_surface_v6);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wlr_surface_is_xwayland_surface(wlr_surface)) {
|
|
|
|
|
|
|
|
struct wlr_xwayland_surface *xsurface =
|
|
|
|
|
|
|
|
wlr_xwayland_surface_from_wlr_surface(wlr_surface);
|
|
|
|
|
|
|
|
return view_from_wlr_xwayland_surface(xsurface);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wlr_surface_is_subsurface(wlr_surface)) {
|
|
|
|
|
|
|
|
struct wlr_subsurface *subsurface =
|
|
|
|
|
|
|
|
wlr_subsurface_from_wlr_surface(wlr_surface);
|
|
|
|
|
|
|
|
return view_from_wlr_surface(subsurface->parent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (wlr_surface_is_layer_surface(wlr_surface)) {
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wlr_log(L_DEBUG, "Surface of unknown type (role %s): %p",
|
|
|
|
|
|
|
|
wlr_surface->role, wlr_surface);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static size_t append_prop(char *buffer, const char *value) {
|
|
|
|
static size_t append_prop(char *buffer, const char *value) {
|
|
|
|
if (!value) {
|
|
|
|
if (!value) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|