xdg-shell: validate positioner object

According to the xdg-shell v6 protocol a positioner object is only
complete if both the size and its anchor rectangle are set. Ensure the
weston clients do this and let weston be more strict on checking if a
client has done so.

This also fixes weston-terminal popups not showing up on gnome-shell
3.22.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
This commit is contained in:
Sjoerd Simons
2016-09-23 09:31:23 +02:00
committed by Jonas Ådahl
parent 7da3823ae3
commit be8a6d3cfb
2 changed files with 14 additions and 2 deletions
+5 -2
View File
@@ -5487,13 +5487,14 @@ window_create_menu(struct display *display,
static struct zxdg_positioner_v6 *
create_simple_positioner(struct display *display,
int x, int y)
int x, int y, int w, int h)
{
struct zxdg_positioner_v6 *positioner;
positioner = zxdg_shell_v6_create_positioner(display->xdg_shell);
fail_on_null(positioner, 0, __FILE__, __LINE__);
zxdg_positioner_v6_set_anchor_rect(positioner, x, y, 1, 1);
zxdg_positioner_v6_set_size(positioner, w, h);
zxdg_positioner_v6_set_anchor(positioner,
ZXDG_POSITIONER_V6_ANCHOR_TOP |
ZXDG_POSITIONER_V6_ANCHOR_LEFT);
@@ -5545,7 +5546,9 @@ window_show_menu(struct display *display,
positioner = create_simple_positioner(display,
window->x - (ix + parent_geometry.x),
window->y - (iy + parent_geometry.y));
window->y - (iy + parent_geometry.y),
frame_width(menu->frame),
frame_height(menu->frame));
window->xdg_popup =
zxdg_surface_v6_get_popup(window->xdg_surface,
parent->xdg_surface,