mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
shell: Use new try_from surface getters
This commit is contained in:
parent
8df120dafd
commit
4ea6a8b1a7
2 changed files with 10 additions and 5 deletions
2
seat.c
2
seat.c
|
|
@ -65,7 +65,7 @@ desktop_view_at(struct cg_server *server, double lx, double ly, struct wlr_surfa
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node);
|
struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node);
|
||||||
struct wlr_scene_surface *scene_surface = wlr_scene_surface_from_buffer(scene_buffer);
|
struct wlr_scene_surface *scene_surface = wlr_scene_surface_try_from_buffer(scene_buffer);
|
||||||
if (!scene_surface) {
|
if (!scene_surface) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
xdg_shell.c
13
xdg_shell.c
|
|
@ -46,11 +46,13 @@ static struct cg_view *
|
||||||
popup_get_view(struct wlr_xdg_popup *popup)
|
popup_get_view(struct wlr_xdg_popup *popup)
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
if (popup->parent == NULL || !wlr_surface_is_xdg_surface(popup->parent)) {
|
if (popup->parent == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_try_from_wlr_surface(popup->parent);
|
||||||
|
if (xdg_surface == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_from_wlr_surface(popup->parent);
|
|
||||||
switch (xdg_surface->role) {
|
switch (xdg_surface->role) {
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||||
return xdg_surface->data;
|
return xdg_surface->data;
|
||||||
|
|
@ -254,7 +256,10 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_scene_tree *parent_scene_tree = NULL;
|
struct wlr_scene_tree *parent_scene_tree = NULL;
|
||||||
struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent);
|
struct wlr_xdg_surface *parent = wlr_xdg_surface_try_from_wlr_surface(popup->parent);
|
||||||
|
if (parent == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (parent->role) {
|
switch (parent->role) {
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:;
|
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:;
|
||||||
parent_scene_tree = view->scene_tree;
|
parent_scene_tree = view->scene_tree;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue