From 54c4564e370a27e38e0a0879295a28eeec22171c Mon Sep 17 00:00:00 2001 From: Nicolas Guyomard Date: Thu, 4 Dec 2014 15:41:35 +0100 Subject: [PATCH] shell: support new function "xdg_surface_needs_attention" Clients can now unminimize themselves. They will be shown in the foreground when doing so. Change-Id: I57db63e717ad52ac88b9af0dd1a7975ccbf828fb --- desktop-shell/shell.c | 14 ++++++++++++++ protocol/xdg-shell.xml | 2 ++ 2 files changed, 16 insertions(+) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 50f9092e..87c8598e 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3951,6 +3951,19 @@ xdg_surface_set_minimized(struct wl_client *client, set_minimized(shsurf->surface); } +static void +xdg_surface_needs_attention(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 un-minimization logic (show) */ + set_minimized(shsurf->surface); +} + static const struct xdg_surface_interface xdg_surface_implementation = { xdg_surface_destroy, xdg_surface_set_parent, @@ -3966,6 +3979,7 @@ static const struct xdg_surface_interface xdg_surface_implementation = { xdg_surface_set_fullscreen, xdg_surface_unset_fullscreen, xdg_surface_set_minimized, + xdg_surface_needs_attention, }; static void diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml index 44a3a12c..7b60818c 100644 --- a/protocol/xdg-shell.xml +++ b/protocol/xdg-shell.xml @@ -489,6 +489,8 @@ + + The close event is sent by the compositor when the user -- 2.34.1