|
|
|
@ -96,6 +96,9 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) {
|
|
|
|
|
static void xdg_surface_handle_ack_configure(struct wl_client *client,
|
|
|
|
|
struct wl_resource *resource, uint32_t serial) {
|
|
|
|
|
struct wlr_xdg_surface *surface = wlr_xdg_surface_from_resource(resource);
|
|
|
|
|
if (surface == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (surface->role == WLR_XDG_SURFACE_ROLE_NONE) {
|
|
|
|
|
wl_resource_post_error(surface->resource,
|
|
|
|
@ -236,6 +239,9 @@ static void xdg_surface_handle_get_popup(struct wl_client *client,
|
|
|
|
|
wlr_xdg_surface_from_resource(resource);
|
|
|
|
|
struct wlr_xdg_surface *parent =
|
|
|
|
|
wlr_xdg_surface_from_resource(parent_resource);
|
|
|
|
|
if (xdg_surface == NULL) {
|
|
|
|
|
return; // TODO: create an inert xdg_popup
|
|
|
|
|
}
|
|
|
|
|
struct wlr_xdg_positioner_resource *positioner =
|
|
|
|
|
get_xdg_positioner_from_resource(positioner_resource);
|
|
|
|
|
create_xdg_popup(xdg_surface, parent, positioner, id);
|
|
|
|
@ -245,6 +251,9 @@ static void xdg_surface_handle_get_toplevel(struct wl_client *client,
|
|
|
|
|
struct wl_resource *resource, uint32_t id) {
|
|
|
|
|
struct wlr_xdg_surface *xdg_surface =
|
|
|
|
|
wlr_xdg_surface_from_resource(resource);
|
|
|
|
|
if (xdg_surface == NULL) {
|
|
|
|
|
return; // TODO: create an inert xdg_toplevel
|
|
|
|
|
}
|
|
|
|
|
create_xdg_toplevel(xdg_surface, id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,6 +261,9 @@ static void xdg_surface_handle_set_window_geometry(struct wl_client *client,
|
|
|
|
|
struct wl_resource *resource, int32_t x, int32_t y, int32_t width,
|
|
|
|
|
int32_t height) {
|
|
|
|
|
struct wlr_xdg_surface *surface = wlr_xdg_surface_from_resource(resource);
|
|
|
|
|
if (surface == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (surface->role == WLR_XDG_SURFACE_ROLE_NONE) {
|
|
|
|
|
wl_resource_post_error(surface->resource,
|
|
|
|
@ -277,6 +289,9 @@ static void xdg_surface_handle_set_window_geometry(struct wl_client *client,
|
|
|
|
|
static void xdg_surface_handle_destroy(struct wl_client *client,
|
|
|
|
|
struct wl_resource *resource) {
|
|
|
|
|
struct wlr_xdg_surface *surface = wlr_xdg_surface_from_resource(resource);
|
|
|
|
|
if (surface == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (surface->role != WLR_XDG_SURFACE_ROLE_NONE) {
|
|
|
|
|
wlr_log(WLR_ERROR, "Tried to destroy an xdg_surface before its role "
|
|
|
|
@ -502,7 +517,6 @@ void destroy_xdg_surface(struct wlr_xdg_surface *surface) {
|
|
|
|
|
|
|
|
|
|
struct wlr_xdg_surface *wlr_xdg_surface_from_resource(
|
|
|
|
|
struct wl_resource *resource) {
|
|
|
|
|
// TODO: Double check that all of the callers can deal with NULL
|
|
|
|
|
if (!resource) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|