aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/types/wlr_xdg_shell.h11
-rw-r--r--include/wlr/types/wlr_xdg_shell.h17
2 files changed, 19 insertions, 9 deletions
diff --git a/include/types/wlr_xdg_shell.h b/include/types/wlr_xdg_shell.h
index 96cc117f..34dec2ad 100644
--- a/include/types/wlr_xdg_shell.h
+++ b/include/types/wlr_xdg_shell.h
@@ -5,16 +5,13 @@
#include <wlr/types/wlr_xdg_shell.h>
#include "xdg-shell-protocol.h"
-extern const struct wlr_surface_role xdg_toplevel_surface_role;
-extern const struct wlr_surface_role xdg_popup_surface_role;
-
void create_xdg_surface(struct wlr_xdg_client *client, struct wlr_surface *wlr_surface,
uint32_t id);
void destroy_xdg_surface(struct wlr_xdg_surface *surface);
-void destroy_xdg_surface_role_object(struct wlr_xdg_surface *surface);
-void xdg_surface_role_commit(struct wlr_surface *wlr_surface);
-void xdg_surface_role_unmap(struct wlr_surface *wlr_surface);
-void xdg_surface_role_destroy(struct wlr_surface *wlr_surface);
+
+bool set_xdg_surface_role(struct wlr_xdg_surface *surface, enum wlr_xdg_surface_role role);
+void set_xdg_surface_role_object(struct wlr_xdg_surface *surface,
+ struct wl_resource *role_resource);
void create_xdg_positioner(struct wlr_xdg_client *client, uint32_t id);
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 9cae226c..1b15bfe4 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -231,8 +231,18 @@ struct wlr_xdg_surface {
struct wl_resource *resource;
struct wlr_surface *surface;
struct wl_list link; // wlr_xdg_client.surfaces
+
+ /**
+ * The lifetime-bound role of the xdg_surface. WLR_XDG_SURFACE_ROLE_NONE
+ * if the role was never set.
+ */
enum wlr_xdg_surface_role role;
+ /**
+ * The role object representing the role. NULL if the object was destroyed.
+ */
+ struct wl_resource *role_resource;
+ // NULL if the role resource is inert
union {
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_popup *popup;
@@ -247,8 +257,6 @@ struct wlr_xdg_surface {
struct wlr_xdg_surface_state current, pending;
- struct wl_listener surface_commit;
-
struct {
struct wl_signal destroy;
struct wl_signal ping_timeout;
@@ -260,6 +268,11 @@ struct wlr_xdg_surface {
} events;
void *data;
+
+ // private state
+
+ bool client_mapped;
+ struct wl_listener role_resource_destroy;
};
struct wlr_xdg_toplevel_move_event {