From b0437fc416e2938f49449c3d9cb1a8107544c335 Mon Sep 17 00:00:00 2001
From: Kirill Primak <vyivel@eclair.cafe>
Date: Sat, 4 Mar 2023 22:14:50 +0300
Subject: xdg-shell: use unified map logic

---
 include/types/wlr_xdg_shell.h     |  3 +--
 include/wlr/types/wlr_xdg_shell.h | 18 +-----------------
 2 files changed, 2 insertions(+), 19 deletions(-)

(limited to 'include')

diff --git a/include/types/wlr_xdg_shell.h b/include/types/wlr_xdg_shell.h
index eb619fba..0386388b 100644
--- a/include/types/wlr_xdg_shell.h
+++ b/include/types/wlr_xdg_shell.h
@@ -14,8 +14,7 @@ struct wlr_xdg_surface *create_xdg_surface(
 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_precommit(struct wlr_surface *wlr_surface,
-	const struct wlr_surface_state *state);
+void xdg_surface_role_unmap(struct wlr_surface *wlr_surface);
 void xdg_surface_role_destroy(struct wlr_surface *wlr_surface);
 
 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 d1072d0d..7678a168 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -251,7 +251,7 @@ struct wlr_xdg_surface {
 
 	struct wl_list popups; // wlr_xdg_popup.link
 
-	bool added, configured, mapped;
+	bool added, configured;
 	struct wl_event_source *configure_idle;
 	uint32_t scheduled_serial;
 	struct wl_list configure_list;
@@ -264,22 +264,6 @@ struct wlr_xdg_surface {
 		struct wl_signal destroy;
 		struct wl_signal ping_timeout;
 		struct wl_signal new_popup;
-		/**
-		 * The `map` event signals that the shell surface is ready to be
-		 * managed by the compositor and rendered on the screen. At this point,
-		 * the surface has configured its properties, has had the opportunity
-		 * to bind to the seat to receive input events, and has a buffer that
-		 * is ready to be rendered. You can now safely add this surface to a
-		 * list of views.
-		 */
-		struct wl_signal map;
-		/**
-		 * The `unmap` event signals that the surface is no longer in a state
-		 * where it should be shown on the screen. This might happen if the
-		 * surface no longer has a displayable buffer because either the
-		 * surface has been hidden or is about to be destroyed.
-		 */
-		struct wl_signal unmap;
 
 		// for protocol extensions
 		struct wl_signal configure; // struct wlr_xdg_surface_configure
-- 
cgit v1.2.3