shell: support new function "xdg_surface_needs_attention" 28/31428/2
authorNicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>
Thu, 4 Dec 2014 14:41:35 +0000 (15:41 +0100)
committerNicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>
Mon, 8 Dec 2014 13:04:57 +0000 (14:04 +0100)
Clients can now unminimize themselves. They will be shown in the
foreground when doing so.

Change-Id: I57db63e717ad52ac88b9af0dd1a7975ccbf828fb

desktop-shell/shell.c
protocol/xdg-shell.xml

index 7a3c3c4..dd67dbf 100644 (file)
@@ -3819,6 +3819,19 @@ xdg_surface_set_minimized(struct wl_client *client,
        set_minimized(shsurf->surface, 1);
 }
 
+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, 0);
+}
+
 static const struct xdg_surface_interface xdg_surface_implementation = {
        xdg_surface_destroy,
        xdg_surface_set_parent,
@@ -3834,6 +3847,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
index 275837f..5816107 100644 (file)
 
     <request name="set_minimized" />
 
+    <request name="needs_attention" />
+
     <event name="close">
       <description summary="surface wants to be closed">
         The close event is sent by the compositor when the user