summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>2014-12-04 15:41:35 +0100
committerNicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>2014-12-08 14:04:57 +0100
commit3d7362346a2b22f2ccef0dd2aa6cde8e28a11aea (patch)
treeadfd63fa7d910d2abaa26cb4efcc7d12e323bf19
parent18def246cb8ba3755b82d8243e3f4a50585c543a (diff)
downloadweston-3d7362346a2b22f2ccef0dd2aa6cde8e28a11aea.tar.gz
weston-3d7362346a2b22f2ccef0dd2aa6cde8e28a11aea.tar.bz2
weston-3d7362346a2b22f2ccef0dd2aa6cde8e28a11aea.zip
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
-rw-r--r--desktop-shell/shell.c14
-rw-r--r--protocol/xdg-shell.xml2
2 files changed, 16 insertions, 0 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 7a3c3c47..dd67dbf9 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -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
diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml
index 275837f3..5816107b 100644
--- a/protocol/xdg-shell.xml
+++ b/protocol/xdg-shell.xml
@@ -353,6 +353,8 @@
<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