aaaah much smoother opaque resiz.e. we're all happy now :)
authorCarsten Haitzler <raster@rasterman.com>
Tue, 27 Mar 2001 19:02:37 +0000 (19:02 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Tue, 27 Mar 2001 19:02:37 +0000 (19:02 +0000)
SVN revision: 4460

src/actions.c
src/border.c

index 09f3690..7ec638a 100644 (file)
@@ -561,20 +561,29 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
    if (!b) b = e_border_current_focused();
    if (!b) return;
    if (b->current.shaded != 0) return;
-   /* 0 | 1 */
+   e_window_gravity_set(b->win.client, StaticGravity);
+   e_window_gravity_set(b->win.l, NorthWestGravity);
+   e_window_gravity_set(b->win.r, SouthEastGravity);
+   e_window_gravity_set(b->win.t, NorthWestGravity);
+   e_window_gravity_set(b->win.b, SouthEastGravity);
+   e_window_gravity_set(b->win.input, NorthWestGravity);
+   e_window_gravity_set(b->win.container, NorthWestGravity);
+   /* 1 | 2 */
    /* --+-- */
-   /* 2 | 3 */
+   /* 3 | 4 */
    if (x > (b->current.w / 2)) 
      {
        if (y > (b->current.h / 2)) 
          {
             b->mode.resize = 4;
-            SET_BORDER_GRAVITY(b, NorthWestGravity);
+/*          SET_BORDER_GRAVITY(b, NorthWestGravity);*/
+/*          e_window_gravity_set(b->win.container, SouthEastGravity);*/
          }
        else 
          {
             b->mode.resize = 2;
-            SET_BORDER_GRAVITY(b, SouthWestGravity);
+/*          SET_BORDER_GRAVITY(b, SouthWestGravity);*/
+/*          e_window_gravity_set(b->win.container, NorthEastGravity);*/
          }
      }
    else
@@ -582,12 +591,14 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
        if (y > (b->current.h / 2)) 
          {
             b->mode.resize = 3;
-            SET_BORDER_GRAVITY(b, NorthEastGravity);
+/*          SET_BORDER_GRAVITY(b, NorthEastGravity);*/
+/*          e_window_gravity_set(b->win.container, SouthWestGravity);*/
          }
        else 
          {
             b->mode.resize = 1;
-            SET_BORDER_GRAVITY(b, SouthEastGravity);
+/*          SET_BORDER_GRAVITY(b, SouthEastGravity);*/
+/*          e_window_gravity_set(b->win.container, NorthWestGravity); */
          }
      }
    return;
@@ -613,6 +624,8 @@ e_act_resize_stop  (void *o, E_Action *a, void *data, int x, int y, int rx, int
    b->mode.resize = 0;
    b->changed = 1;
    e_border_adjust_limits(b);
+   e_window_gravity_set(b->win.client, NorthWestGravity);
+   SET_BORDER_GRAVITY(b, NorthWestGravity);
    return;
    UN(a);
    UN(data);
@@ -676,16 +689,23 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
    if (!b) b = e_border_current_focused();
    if (!b) return;
    if (b->current.shaded != 0) return;
-   /* 4 | 5 */
+   e_window_gravity_set(b->win.client, StaticGravity);
+   e_window_gravity_set(b->win.l, NorthWestGravity);
+   e_window_gravity_set(b->win.r, SouthEastGravity);
+   e_window_gravity_set(b->win.t, NorthWestGravity);
+   e_window_gravity_set(b->win.b, SouthEastGravity);
+   e_window_gravity_set(b->win.input, NorthWestGravity);
+   e_window_gravity_set(b->win.container, NorthWestGravity);
+   /* 5 | 6 */
    if (x > (b->current.w / 2)) 
      {
        b->mode.resize = 6;
-       SET_BORDER_GRAVITY(b, NorthWestGravity);
+/*     SET_BORDER_GRAVITY(b, NorthWestGravity);*/
      }
    else 
      {
        b->mode.resize = 5;
-       SET_BORDER_GRAVITY(b, NorthEastGravity);
+/*     SET_BORDER_GRAVITY(b, NorthEastGravity);*/
      }
    return;
    UN(a);
@@ -711,6 +731,8 @@ e_act_resize_h_stop  (void *o, E_Action *a, void *data, int x, int y, int rx, in
    b->mode.resize = 0;
    b->changed = 1;
    e_border_adjust_limits(b);
+   e_window_gravity_set(b->win.client, NorthWestGravity);
+   SET_BORDER_GRAVITY(b, NorthWestGravity);
    return;
    UN(a);
    UN(data);
@@ -760,18 +782,25 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
    if (!b) b = e_border_current_focused();
    if (!b) return;
    if (b->current.shaded != 0) return;
-   /* 6 */
-   /* - */
+   e_window_gravity_set(b->win.client, StaticGravity);
+   e_window_gravity_set(b->win.l, NorthWestGravity);
+   e_window_gravity_set(b->win.r, SouthEastGravity);
+   e_window_gravity_set(b->win.t, NorthWestGravity);
+   e_window_gravity_set(b->win.b, SouthEastGravity);
+   e_window_gravity_set(b->win.input, NorthWestGravity);
+   e_window_gravity_set(b->win.container, NorthWestGravity);
    /* 7 */
+   /* - */
+   /* 8 */
    if (y > (b->current.h / 2)) 
      {
        b->mode.resize = 8;
-       SET_BORDER_GRAVITY(b, NorthWestGravity);
+/*     SET_BORDER_GRAVITY(b, NorthWestGravity);*/
      }
    else 
      {
        b->mode.resize = 7;
-       SET_BORDER_GRAVITY(b, SouthWestGravity);
+/*     SET_BORDER_GRAVITY(b, SouthWestGravity);*/
      }
    return;
    UN(a);
@@ -796,6 +825,8 @@ e_act_resize_v_stop  (void *o, E_Action *a, void *data, int x, int y, int rx, in
    b->current.requested.h = b->current.h;
    b->mode.resize = 0;
    e_border_adjust_limits(b);
+   e_window_gravity_set(b->win.client, NorthWestGravity);
+   SET_BORDER_GRAVITY(b, NorthWestGravity);
    b->changed = 1;
    return;
    UN(a);
index 5d966d4..b0629de 100644 (file)
@@ -1347,6 +1347,10 @@ e_border_new(void)
    
    e_window_raise(b->win.input);
    e_window_raise(b->win.container);
+   e_window_raise(b->win.l);
+   e_window_raise(b->win.r);
+   e_window_raise(b->win.t);
+   e_window_raise(b->win.b);
    
    evases = evas_list_append(evases, b->evas.l);
    evases = evas_list_append(evases, b->evas.r);
@@ -1835,71 +1839,143 @@ e_border_update(E_Border *b)
        if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
        e_window_move_resize(b->win.input, 
                             0, 0, b->current.w, b->current.h);
-       e_window_move_resize(b->win.main, 
-                            b->current.x, b->current.y,
-                            b->current.w, b->current.h);
-       if (b->current.shaded == b->client.h)
+       if (smaller)
          {
-            e_window_move_resize(b->win.client, 
-                                 0, - b->current.shaded,
-                                 b->client.w,
-                                 b->client.h);
-            e_window_move_resize(b->win.container,
-                                 b->current.w + 1, 
-                                 b->current.h + 1,
-                                 320, 
-                                 320);
+            if (b->current.shaded == b->client.h)
+              {
+                 e_window_move_resize(b->win.client, 
+                                      0, - b->current.shaded,
+                                      b->client.w,
+                                      b->client.h);
+                 e_window_move_resize(b->win.container,
+                                      b->current.w + 1, 
+                                      b->current.h + 1,
+                                      320, 
+                                      320);
+              }
+            else
+              {
+                 e_window_move_resize(b->win.client, 
+                                      0, - b->current.shaded,
+                                      b->client.w,
+                                      b->client.h);
+                 e_window_move_resize(b->win.container, 
+                                      pl, 
+                                      pt,
+                                      b->current.w - pl - pr, 
+                                      b->current.h - pt - pb);
+              }
+            e_window_move_resize(b->win.main, 
+                                 b->current.x, b->current.y,
+                                 b->current.w, b->current.h);
+            x = 0, y = pt, w = pl, h = (b->current.h - pt - pb);
+            if ((w <1) || (h < 1)) e_window_hide(b->win.l);
+            else 
+              {
+                 e_window_show(b->win.l);
+                 e_window_move_resize(b->win.l, x, y, w, h);
+                 evas_set_output_size(b->evas.l, w, h);
+                 evas_set_output_viewport(b->evas.l, x, y, w, h);
+              }
+            
+            x = 0, y = 0, w = b->current.w, h = pt;
+            if ((w <1) || (h < 1)) e_window_hide(b->win.t);
+            else 
+              {
+                 e_window_show(b->win.t);
+                 e_window_move_resize(b->win.t, x, y, w, h);
+                 evas_set_output_size(b->evas.t, w, h);
+                 evas_set_output_viewport(b->evas.t, x, y, w, h);
+              }
+            
+            x = b->current.w - pr, y = pt, w = pr, h = (b->current.h - pt - pb);
+            if ((w <1) || (h < 1)) e_window_hide(b->win.r);
+            else 
+              {
+                 e_window_show(b->win.r);
+                 e_window_move_resize(b->win.r, x, y, w, h);
+                 evas_set_output_size(b->evas.r, w, h);
+                 evas_set_output_viewport(b->evas.r, x, y, w, h);
+              }
+            
+            x = 0, y = b->current.h - pb, w = b->current.w, h = pb;
+            if ((w <1) || (h < 1)) e_window_hide(b->win.b);
+            else 
+              {
+                 e_window_show(b->win.b);
+                 e_window_move_resize(b->win.b, x, y, w, h);
+                 evas_set_output_size(b->evas.b, w, h);
+                 evas_set_output_viewport(b->evas.b, x, y, w, h);
+              }
          }
        else
          {
-            e_window_move_resize(b->win.client, 
-                                 0, - b->current.shaded,
-                                 b->client.w,
-                                 b->client.h);
-            e_window_move_resize(b->win.container, 
-                                 pl, 
-                                 pt,
-                                 b->current.w - pl - pr, 
-                                 b->current.h - pt - pb);
-         }
-       x = 0, y = pt, w = pl, h = (b->current.h - pt - pb);
-       if ((w <1) || (h < 1)) e_window_hide(b->win.l);
-       else 
-         {
-            e_window_show(b->win.l);
-            e_window_move_resize(b->win.l, x, y, w, h);
-            evas_set_output_size(b->evas.l, w, h);
-            evas_set_output_viewport(b->evas.l, x, y, w, h);
-         }
-       
-       x = 0, y = 0, w = b->current.w, h = pt;
-       if ((w <1) || (h < 1)) e_window_hide(b->win.t);
-       else 
-         {
-            e_window_show(b->win.t);
-            e_window_move_resize(b->win.t, x, y, w, h);
-            evas_set_output_size(b->evas.t, w, h);
-            evas_set_output_viewport(b->evas.t, x, y, w, h);
-         }
-       
-       x = b->current.w - pr, y = pt, w = pr, h = (b->current.h - pt - pb);
-       if ((w <1) || (h < 1)) e_window_hide(b->win.r);
-       else 
-         {
-            e_window_show(b->win.r);
-            e_window_move_resize(b->win.r, x, y, w, h);
-            evas_set_output_size(b->evas.r, w, h);
-            evas_set_output_viewport(b->evas.r, x, y, w, h);
-         }
-       
-       x = 0, y = b->current.h - pb, w = b->current.w, h = pb;
-       if ((w <1) || (h < 1)) e_window_hide(b->win.b);
-       else 
-         {
-            e_window_show(b->win.b);
-            e_window_move_resize(b->win.b, x, y, w, h);
-            evas_set_output_size(b->evas.b, w, h);
-            evas_set_output_viewport(b->evas.b, x, y, w, h);
+            e_window_move_resize(b->win.main, 
+                                 b->current.x, b->current.y,
+                                 b->current.w, b->current.h);
+            x = 0, y = pt, w = pl, h = (b->current.h - pt - pb);
+            if ((w <1) || (h < 1)) e_window_hide(b->win.l);
+            else 
+              {
+                 e_window_show(b->win.l);
+                 e_window_move_resize(b->win.l, x, y, w, h);
+                 evas_set_output_size(b->evas.l, w, h);
+                 evas_set_output_viewport(b->evas.l, x, y, w, h);
+              }
+            
+            x = 0, y = 0, w = b->current.w, h = pt;
+            if ((w <1) || (h < 1)) e_window_hide(b->win.t);
+            else 
+              {
+                 e_window_show(b->win.t);
+                 e_window_move_resize(b->win.t, x, y, w, h);
+                 evas_set_output_size(b->evas.t, w, h);
+                 evas_set_output_viewport(b->evas.t, x, y, w, h);
+              }
+            
+            x = b->current.w - pr, y = pt, w = pr, h = (b->current.h - pt - pb);
+            if ((w <1) || (h < 1)) e_window_hide(b->win.r);
+            else 
+              {
+                 e_window_show(b->win.r);
+                 e_window_move_resize(b->win.r, x, y, w, h);
+                 evas_set_output_size(b->evas.r, w, h);
+                 evas_set_output_viewport(b->evas.r, x, y, w, h);
+              }
+            
+            x = 0, y = b->current.h - pb, w = b->current.w, h = pb;
+            if ((w <1) || (h < 1)) e_window_hide(b->win.b);
+            else 
+              {
+                 e_window_show(b->win.b);
+                 e_window_move_resize(b->win.b, x, y, w, h);
+                 evas_set_output_size(b->evas.b, w, h);
+                 evas_set_output_viewport(b->evas.b, x, y, w, h);
+              }
+            if (b->current.shaded == b->client.h)
+              {
+                 e_window_move_resize(b->win.container,
+                                      b->current.w + 1, 
+                                      b->current.h + 1,
+                                      320, 
+                                      320);
+                 e_window_move_resize(b->win.client, 
+                                      0, - b->current.shaded,
+                                      b->client.w,
+                                      b->client.h);
+              }
+            else
+              {
+                 e_window_move_resize(b->win.container, 
+                                      pl, 
+                                      pt,
+                                      b->current.w - pl - pr, 
+                                      b->current.h - pt - pb);
+                 e_window_move_resize(b->win.client, 
+                                      0, - b->current.shaded,
+                                      b->client.w,
+                                      b->client.h);
+              }
          }
             
        if (b->bits.l) ebits_resize(b->bits.l, b->current.w, b->current.h);