[PATCH weston 09/10] xserver: add support for popup windows

Tiago Vignatti tiago.vignatti at intel.com
Fri May 18 08:47:16 PDT 2012


Quite nice, we don't need our internal logic to grab the pointer cause the X
server does already it for us.

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

diff --git a/src/xserver-launcher.c b/src/xserver-launcher.c
index 2cf5d1f..e557b8f 100644
--- a/src/xserver-launcher.c
+++ b/src/xserver-launcher.c
@@ -1786,6 +1786,7 @@ xserver_map_shell_surface(struct weston_wm *wm,
 	struct weston_wm_window *parent;
 	struct wl_pointer pointer;
 	const int offset_y = 20;
+	int x, y;
 
 	if (!shell_interface->create_shell_surface)
 		return;
@@ -1806,6 +1807,13 @@ xserver_map_shell_surface(struct weston_wm *wm,
 		    wl_fixed_to_int(pointer.y) - parent->surface->geometry.y +
 		    offset_y,
 		    WL_SHELL_SURFACE_TRANSIENT_METHOD_INACTIVE);
+	} else if (!strcmp(window->atom_name,
+			   "_NET_WM_WINDOW_TYPE_POPUP_MENU")) {
+		x = window->configured_x - window->transient_for->configured_x;
+		y = window->configured_y - window->transient_for->configured_y;
+
+		shell_interface->set_transient(window->shsurf, parent->shsurf,
+		    x ,y, WL_SHELL_SURFACE_TRANSIENT_METHOD_INACTIVE);
 	} else {
 		shell_interface->set_transient(window->shsurf, parent->shsurf,
 		    window->configured_x, window->configured_y,
-- 
1.7.9.5



More information about the wayland-devel mailing list