use more accurate heuristics when calculating ConfigureRequest move coords:
authordiscomfitor <michael.blumenkrantz@gmail.com>
Thu, 26 Sep 2013 18:11:33 +0000 (19:11 +0100)
committerdiscomfitor <michael.blumenkrantz@gmail.com>
Fri, 27 Sep 2013 05:20:17 +0000 (06:20 +0100)
1) invalidate moves resulting from stupid clients trying to re-set their current position (SUP WINE. YEAH, I'M TALKIN TO YOU, BUDDY. WHY YOU GOTTA BE MESSIN WITH MY WINDOW COORDS?)

2) clamp coords when screen limit policy is set to prevent clients from being outside the screen at all

3) all things are allowed, nothing is prohibited

src/bin/e_border.c

index c148b62e5c8e7cb61d5c7fb0b2851390d9bb7c63..1f80a3ccf4374b52995e306f328fc59225debe53 100644 (file)
@@ -5196,13 +5196,29 @@ _e_border_cb_window_configure_request(void *data  __UNUSED__,
           e_zone_useful_geometry_get(bd->zone, &zx, &zy, &zw, &zh);
         if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X)
           {
-             x = e->x;
-             if (x - bd->client_inset.l >= zx) x -= bd->client_inset.l;
+             /* ignore moves (usually from wine clients)
+              * which would cause the window to jump
+              * by the size of the frame
+              */
+             if (bd->x + bd->client_inset.l == e->x)
+               x = bd->x;
+             else if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+               x = E_CLAMP(e->x, zx, zx + zw - bd->w);
+             else
+               x = e->x;
           }
         if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y)
           {
-             y = e->y;
-             if (y - bd->client_inset.t >= zy) y -= bd->client_inset.t;
+             /* ignore moves (usually from wine clients)
+              * which would cause the window to jump
+              * by the size of the frame
+              */
+             if (bd->y + bd->client_inset.t == e->y)
+               y = bd->y;
+             else if (e_config->screen_limits == E_SCREEN_LIMITS_WITHIN)
+               y = E_CLAMP(e->y, zy, zy + zh - bd->h);
+             else
+               y = e->y;
           }
         if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W) ||
             (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H))