[PATCH weston client window] Fixed the input region of the popup menu

Tomek Obrebski t.obrebski at samsung.com
Mon Jun 2 04:53:38 PDT 2014


Changed the input region of the menu popup window to exclude the shadow and border regions and set to frame's internal region only.

Regards,
blsd

---
 clients/window.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/clients/window.c b/clients/window.c
index b82a93e..9a6e8be 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -4615,7 +4615,8 @@ window_show_menu(struct display *display,
 {
 	struct menu *menu;
 	struct window *window;
-	int32_t ix, iy;
+    struct wl_region *input_region;
+    int32_t ix, iy, ih, iw;
 
 	menu = create_menu(display, input, time, func, entries, count, parent);
 
@@ -4630,7 +4631,11 @@ window_show_menu(struct display *display,
 	window->x = x;
 	window->y = y;
 
-	frame_interior(menu->frame, &ix, &iy, NULL, NULL);
+    frame_interior(menu->frame, &ix, &iy, &iw, &ih);
+    input_region = wl_compositor_create_region(display->compositor);
+    wl_region_add(input_region, ix, iy, iw, ih);
+    wl_surface_set_input_region(window->main_surface->surface, input_region);
+    wl_region_destroy(input_region);
 
 	window->xdg_popup = xdg_shell_get_xdg_popup(display->xdg_shell,
 						    window->main_surface->surface,
-- 
1.9.1



More information about the wayland-devel mailing list