[PATCH weston 3/8] shell: use transient flags for activate or not new surfaces

Tiago Vignatti tiago.vignatti at intel.com
Mon May 7 05:23:09 PDT 2012


Creating a surface inactive impacts in two different behaviors: not setting
keyboard focus on the new surface and not re-stacking it below panel layer.
Tooltips, dialogs and other kind of windows can benefit from this.

This requires protocol side changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 src/shell.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/shell.c b/src/shell.c
index e377120..1fc627d 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -138,6 +138,7 @@ struct shell_surface {
 
 	struct {
 		int32_t x, y;
+		enum wl_shell_surface_transient_method flags;
 	} transient;
 
 	struct {
@@ -835,6 +836,7 @@ shell_surface_set_transient(struct wl_client *client,
 	shsurf->parent = parent_resource->data;
 	shsurf->transient.x = x;
 	shsurf->transient.y = y;
+	shsurf->transient.flags = flags;
 	shsurf->next_type = SHELL_SURFACE_TRANSIENT;
 }
 
@@ -2074,6 +2076,9 @@ map(struct desktop_shell *shell, struct weston_surface *surface,
 	switch (surface_type) {
 	case SHELL_SURFACE_TOPLEVEL:
 	case SHELL_SURFACE_TRANSIENT:
+		if (shsurf->transient.flags ==
+				WL_SHELL_SURFACE_TRANSIENT_METHOD_INACTIVE)
+			break;
 	case SHELL_SURFACE_FULLSCREEN:
 	case SHELL_SURFACE_MAXIMIZED:
 		if (!shell->locked)
-- 
1.7.9.5



More information about the wayland-devel mailing list