mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Fixed crash when wlr_xdg_popup doesn't have a parent
This commit is contained in:
parent
b2e686171f
commit
db79d83076
1 changed files with 8 additions and 6 deletions
|
|
@ -411,12 +411,14 @@ static void handle_new_xdg_popup(struct wl_listener *listener, void *data) {
|
||||||
* we always set the user data field of xdg_surfaces to the corresponding
|
* we always set the user data field of xdg_surfaces to the corresponding
|
||||||
* scene node. */
|
* scene node. */
|
||||||
struct wlr_xdg_popup *xdg_popup = data;
|
struct wlr_xdg_popup *xdg_popup = data;
|
||||||
struct wlr_xdg_surface *parent = wlr_xdg_surface_try_from_wlr_surface(
|
if (xdg_popup->parent) {
|
||||||
xdg_popup->parent);
|
struct wlr_xdg_surface *parent = wlr_xdg_surface_try_from_wlr_surface(
|
||||||
if (parent != NULL) {
|
xdg_popup->parent);
|
||||||
struct wlr_scene_tree *parent_tree = parent->data;
|
if (parent != NULL) {
|
||||||
xdg_popup->base->data = wlr_scene_xdg_surface_create(
|
struct wlr_scene_tree *parent_tree = parent->data;
|
||||||
parent_tree, xdg_popup->base);
|
xdg_popup->base->data = wlr_scene_xdg_surface_create(
|
||||||
|
parent_tree, xdg_popup->base);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wb_popup *popup = calloc(1, sizeof(struct wb_popup));
|
struct wb_popup *popup = calloc(1, sizeof(struct wb_popup));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue