From 60550230a71be950b77927830bc22a58547edbd5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 9 Mar 2018 11:45:02 +0000 Subject: overlay: Remove the miscalculation of window position We already call x11_position() to calculate the position of the overlay, so do not need to manually recompute them inside x11_overlay_create(). This has the advantage that x11_position() understands the multi-monitor layout instructions. Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- overlay/x11/x11-overlay.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'overlay') diff --git a/overlay/x11/x11-overlay.c b/overlay/x11/x11-overlay.c index d08ebfc9..ae649429 100644 --- a/overlay/x11/x11-overlay.c +++ b/overlay/x11/x11-overlay.c @@ -271,22 +271,6 @@ x11_overlay_create(struct config *config, int *width, int *height) priv->x = x; priv->y = y; - if (position != POS_UNSET) { - switch (position & 7) { - default: - case 0: priv->x = 0; break; - case 1: priv->x = (scr->width - image->width)/2; break; - case 2: priv->x = scr->width - image->width; break; - } - - switch ((position >> 4) & 7) { - default: - case 0: priv->y = 0; break; - case 1: priv->y = (scr->height - image->height)/2; break; - case 2: priv->y = scr->height - image->height; break; - } - } - priv->image = image; priv->image->data = (void *)&priv->name; -- cgit v1.2.3