struct kde_deco *kde_deco = znew(*kde_deco);
kde_deco->wlr_kde_decoration = wlr_deco;
- if (wlr_surface_is_xdg_surface(wlr_deco->surface)) {
+ if (wlr_deco->surface) {
/*
* Depending on the application event flow, the supplied
* wlr_surface may already have been set up as a xdg_surface
* kde_server_decoration_set_view().
*/
struct wlr_xdg_surface *xdg_surface =
- wlr_xdg_surface_from_wlr_surface(wlr_deco->surface);
+ wlr_xdg_surface_try_from_wlr_surface(wlr_deco->surface);
if (xdg_surface && xdg_surface->data) {
kde_deco->view = (struct view *)xdg_surface->data;
handle_mode(&kde_deco->mode, wlr_deco);
if (view) {
desktop_focus_view(view, raise);
#if HAVE_XWAYLAND
- } else if (wlr_surface_is_xwayland_surface(surface)) {
+ } else {
struct wlr_xwayland_surface *xsurface =
- wlr_xwayland_surface_from_wlr_surface(surface);
+ wlr_xwayland_surface_try_from_wlr_surface(surface);
if (xsurface && wlr_xwayland_or_surface_wants_focus(xsurface)) {
seat_focus_surface(seat, surface);
}
if (node->type == WLR_SCENE_NODE_BUFFER) {
struct wlr_surface *surface = lab_wlr_surface_from_node(node);
if (surface) {
- if (wlr_surface_is_layer_surface(surface)) {
+ if (wlr_layer_surface_v1_try_from_wlr_surface(surface)) {
ret.type = LAB_SSD_LAYER_SURFACE;
}
if (is_layer_descendant(node)) {
static struct wlr_surface *
get_toplevel(struct wlr_surface *surface)
{
- while (surface && wlr_surface_is_xdg_surface(surface)) {
+ while (surface) {
struct wlr_xdg_surface *xdg_surface =
- wlr_xdg_surface_from_wlr_surface(surface);
+ wlr_xdg_surface_try_from_wlr_surface(surface);
if (!xdg_surface) {
- return NULL;
+ break;
}
switch (xdg_surface->role) {
continue;
}
}
- if (surface && wlr_surface_is_layer_surface(surface)) {
+ if (surface && wlr_layer_surface_v1_try_from_wlr_surface(surface)) {
return surface;
}
return NULL;
if (view) {
lx = view->current.x;
ly = view->current.y;
- } else if (node && wlr_surface_is_layer_surface(surface)) {
+ } else if (node && wlr_layer_surface_v1_try_from_wlr_surface(surface)) {
wlr_scene_node_coords(node, &lx, &ly);
#if HAVE_XWAYLAND
} else if (node && node->parent == server->unmanaged_tree) {
*/
if (ctx.type == LAB_SSD_LAYER_SURFACE) {
struct wlr_layer_surface_v1 *layer =
- wlr_layer_surface_v1_from_wlr_surface(ctx.surface);
+ wlr_layer_surface_v1_try_from_wlr_surface(ctx.surface);
if (layer && layer->current.keyboard_interactive) {
seat_set_focus_layer(seat, layer);
}
* - find a way to get rid of xdg/xwayland-specific stuff
* - look up root/toplevel surface if passed a subsurface?
*/
- if (wlr_surface_is_xdg_surface(surface)) {
- struct wlr_xdg_surface *xdg_surface =
- wlr_xdg_surface_from_wlr_surface(surface);
- if (xdg_surface) {
- return xdg_surface->data;
- }
+ struct wlr_xdg_surface *xdg_surface =
+ wlr_xdg_surface_try_from_wlr_surface(surface);
+ if (xdg_surface) {
+ return xdg_surface->data;
}
#if HAVE_XWAYLAND
- if (wlr_surface_is_xwayland_surface(surface)) {
- struct wlr_xwayland_surface *xsurface =
- wlr_xwayland_surface_from_wlr_surface(surface);
- if (xsurface) {
- return xsurface->data;
- }
+ struct wlr_xwayland_surface *xsurface =
+ wlr_xwayland_surface_try_from_wlr_surface(surface);
+ if (xsurface) {
+ return xsurface->data;
}
#endif
return NULL;
xdg_popup_create(struct view *view, struct wlr_xdg_popup *wlr_popup)
{
struct wlr_xdg_surface *parent =
- wlr_surface_is_xdg_surface(wlr_popup->parent) ?
- wlr_xdg_surface_from_wlr_surface(wlr_popup->parent) : NULL;
+ wlr_xdg_surface_try_from_wlr_surface(wlr_popup->parent);
if (!parent) {
wlr_log(WLR_ERROR, "parent is not a valid XDG surface");
return;
{
const struct wlr_xdg_activation_v1_request_activate_event *event = data;
- if (!wlr_surface_is_xdg_surface(event->surface)) {
+ struct wlr_xdg_surface *xdg_surface =
+ wlr_xdg_surface_try_from_wlr_surface(event->surface);
+ if (!xdg_surface) {
return;
}
- struct wlr_xdg_surface *xdg_surface =
- wlr_xdg_surface_from_wlr_surface(event->surface);
- struct view *view = xdg_surface ? xdg_surface->data : NULL;
+ struct view *view = xdg_surface->data;
if (!view) {
wlr_log(WLR_INFO, "Not activating surface - no view attached to surface");
struct view *view = desktop_topmost_focusable_view(server);
if (view && view->type == LAB_XWAYLAND_VIEW) {
struct wlr_xwayland_surface *surf =
- wlr_xwayland_surface_from_wlr_surface(view->surface);
+ wlr_xwayland_surface_try_from_wlr_surface(view->surface);
if (surf && surf->pid != xsurface->pid) {
return;
}
struct wlr_xwayland_surface *xsurface =
xwayland_surface_from_view(view);
struct wlr_xwayland_surface *xsurface2 =
- wlr_surface_is_xwayland_surface(surface) ?
- wlr_xwayland_surface_from_wlr_surface(surface) : NULL;
+ wlr_xwayland_surface_try_from_wlr_surface(surface);
return (xsurface2 && xsurface2->pid == xsurface->pid);
}
[wrap-git]
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
-revision = 097ea84cda70a71ad8ea5940b3b3d277167424e5
+revision = f9bd416d4156942ce3951a6c5cf9f81a3cf4a3dd
[provide]
dependency_names = wlroots