|
|
@ -40,6 +40,7 @@ struct weston_desktop { |
|
|
|
struct weston_compositor *compositor; |
|
|
|
struct weston_compositor *compositor; |
|
|
|
struct weston_desktop_api api; |
|
|
|
struct weston_desktop_api api; |
|
|
|
void *user_data; |
|
|
|
void *user_data; |
|
|
|
|
|
|
|
struct wl_global *xdg_shell_v6; |
|
|
|
struct wl_global *xdg_shell_v5; |
|
|
|
struct wl_global *xdg_shell_v5; |
|
|
|
struct wl_global *wl_shell; |
|
|
|
struct wl_global *wl_shell; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -69,6 +70,13 @@ weston_desktop_create(struct weston_compositor *compositor, |
|
|
|
MIN(sizeof(struct weston_desktop_api), api->struct_size); |
|
|
|
MIN(sizeof(struct weston_desktop_api), api->struct_size); |
|
|
|
memcpy(&desktop->api, api, desktop->api.struct_size); |
|
|
|
memcpy(&desktop->api, api, desktop->api.struct_size); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
desktop->xdg_shell_v6 = |
|
|
|
|
|
|
|
weston_desktop_xdg_shell_v6_create(desktop, display); |
|
|
|
|
|
|
|
if (desktop->xdg_shell_v6 == NULL) { |
|
|
|
|
|
|
|
weston_desktop_destroy(desktop); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
desktop->xdg_shell_v5 = |
|
|
|
desktop->xdg_shell_v5 = |
|
|
|
weston_desktop_xdg_shell_v5_create(desktop, display); |
|
|
|
weston_desktop_xdg_shell_v5_create(desktop, display); |
|
|
|
if (desktop->xdg_shell_v5 == NULL) { |
|
|
|
if (desktop->xdg_shell_v5 == NULL) { |
|
|
@ -98,6 +106,8 @@ weston_desktop_destroy(struct weston_desktop *desktop) |
|
|
|
wl_global_destroy(desktop->wl_shell); |
|
|
|
wl_global_destroy(desktop->wl_shell); |
|
|
|
if (desktop->xdg_shell_v5 != NULL) |
|
|
|
if (desktop->xdg_shell_v5 != NULL) |
|
|
|
wl_global_destroy(desktop->xdg_shell_v5); |
|
|
|
wl_global_destroy(desktop->xdg_shell_v5); |
|
|
|
|
|
|
|
if (desktop->xdg_shell_v6 != NULL) |
|
|
|
|
|
|
|
wl_global_destroy(desktop->xdg_shell_v6); |
|
|
|
|
|
|
|
|
|
|
|
free(desktop); |
|
|
|
free(desktop); |
|
|
|
} |
|
|
|
} |
|
|
|