On 14/05/2018 09:02, Chris Wilson wrote:
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 <ch...@chris-wilson.co.uk>
---
  overlay/x11/x11-overlay.c | 16 ----------------
  1 file changed, 16 deletions(-)

diff --git a/overlay/x11/x11-overlay.c b/overlay/x11/x11-overlay.c
index d08ebfc9c..ae6494295 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;


Looks OK even without full understanding of the X11 programming.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursu...@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to