[PATCH 6/6] compositor: bind xdg_shell_set_minimized to the new logic

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Tue Feb 18 21:30:38 PST 2014


We bind the xdg call to the same logic used by taskbar.

Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
---
 desktop-shell/shell.c |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 8f50046..8ac9d6d 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3406,6 +3406,26 @@ xdg_surface_unset_maximized(struct wl_client *client,
 	shsurf->client->send_configure(shsurf->surface, 0, width, height);
 }
 
+static void
+xdg_surface_set_minimized(struct wl_client *client,
+			    struct wl_resource *resource)
+{
+	struct shell_surface *shsurf = wl_resource_get_user_data(resource);
+
+	if (shsurf->type != SHELL_SURFACE_TOPLEVEL)
+		return;
+
+	 /* apply compositor's own minimization logic (hide) */
+	set_minimized(shsurf->surface, 1);
+
+	 /* ask taskbar to change corresponding handler button state */
+	struct managed_surface *surface;
+	wl_list_for_each(surface, &shsurf->shell->managed_surfaces_list, link) {
+			if (surface->surface == shsurf->surface)
+				managed_surface_send_state_changed (surface->resource, 1);
+	}
+}
+
 static const struct xdg_surface_interface xdg_surface_implementation = {
 	xdg_surface_destroy,
 	xdg_surface_set_transient_for,
@@ -3419,7 +3439,7 @@ static const struct xdg_surface_interface xdg_surface_implementation = {
 	xdg_surface_unset_fullscreen,
 	xdg_surface_set_maximized,
 	xdg_surface_unset_maximized,
-	NULL /* set_minimized */
+	xdg_surface_set_minimized
 };
 
 static void
-- 
1.7.10.4



More information about the wayland-devel mailing list