kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=a5228ad9e00096bce1232e0795e0398a687cca45

commit a5228ad9e00096bce1232e0795e0398a687cca45
Author: Kim Woelders <[email protected]>
Date:   Thu Apr 21 08:19:01 2022 +0200

    moveresize: Remove long time unused constrained move code
    
    Not active because doMoveConstrained() has been disabled for ages.
    
    Was effectively equivalent to setting misc.snap.screen_snap_dist to
    large value.
---
 src/E.h          |  1 -
 src/arrange.c    | 26 +++++++++++++-------------
 src/ewins.c      |  2 +-
 src/ewins.h      |  3 +--
 src/ewmh.c       |  6 +++---
 src/ipc.c        | 12 ++----------
 src/moveresize.c | 16 +++++-----------
 7 files changed, 25 insertions(+), 41 deletions(-)

diff --git a/src/E.h b/src/E.h
index 3004ac2a..44fced22 100644
--- a/src/E.h
+++ b/src/E.h
@@ -425,7 +425,6 @@ typedef struct {
    EWin               *context_ewin;
    EX_Colormap         current_cmap;
    Win                 context_win;
-   char                constrained;
    char                nogroup;
    char                showing_desktop;
    EX_Window           button_proxy_win;
diff --git a/src/arrange.c b/src/arrange.c
index 11400622..092c6a60 100644
--- a/src/arrange.c
+++ b/src/arrange.c
@@ -458,7 +458,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
 {
    EWin               *const *lst1;
    EWin              **lst, **gwins;
-   int                 gnum, num, i, j, screen_snap_dist, odx, ody;
+   int                 gnum, num, i, j, odx, ody;
    static char         last_res = 0;
    int                 top_bound, bottom_bound, left_bound, right_bound, w, h;
 
@@ -476,7 +476,6 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
                     &left_bound, &top_bound, &w, &h);
    right_bound = left_bound + w;
    bottom_bound = top_bound + h;
-   screen_snap_dist = Mode.constrained ? (w + h) : Conf.snap.screen_snap_dist;
 
    lst1 = EwinListGetAll(&num);
    if (!lst1)
@@ -506,8 +505,9 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
    ody = dy;
    if (dx < 0)
      {
-       if (IN_BELOW(ewin->shape_x + dx, left_bound, screen_snap_dist)
-           && (ewin->shape_x >= left_bound))
+       if (IN_BELOW(ewin->shape_x + dx, left_bound,
+                    Conf.snap.screen_snap_dist) &&
+           (ewin->shape_x >= left_bound))
          {
             dx = left_bound - ewin->shape_x;
          }
@@ -544,9 +544,9 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
      }
    else if (dx > 0)
      {
-       if (IN_ABOVE
-           (ewin->shape_x + EoGetW(ewin) + dx, right_bound, screen_snap_dist)
-           && ((ewin->shape_x + EoGetW(ewin)) <= right_bound))
+       if (IN_ABOVE(ewin->shape_x + EoGetW(ewin) + dx, right_bound,
+                    Conf.snap.screen_snap_dist) &&
+           (ewin->shape_x + EoGetW(ewin) <= right_bound))
          {
             dx = right_bound - (ewin->shape_x + EoGetW(ewin));
          }
@@ -582,8 +582,9 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
 
    if (dy < 0)
      {
-       if (IN_BELOW(ewin->shape_y + dy, top_bound, screen_snap_dist)
-           && (ewin->shape_y >= top_bound))
+       if (IN_BELOW(ewin->shape_y + dy, top_bound,
+                    Conf.snap.screen_snap_dist) &&
+           (ewin->shape_y >= top_bound))
          {
             dy = top_bound - ewin->shape_y;
          }
@@ -620,10 +621,9 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int 
*new_dy)
      }
    else if (dy > 0)
      {
-       if (IN_ABOVE
-           (ewin->shape_y + EoGetH(ewin) + dy, bottom_bound,
-            screen_snap_dist)
-           && ((ewin->shape_y + EoGetH(ewin)) <= bottom_bound))
+       if (IN_ABOVE(ewin->shape_y + EoGetH(ewin) + dy, bottom_bound,
+                    Conf.snap.screen_snap_dist) &&
+           (ewin->shape_y + EoGetH(ewin) <= bottom_bound))
          {
             dy = bottom_bound - (ewin->shape_y + EoGetH(ewin));
          }
diff --git a/src/ewins.c b/src/ewins.c
index ac99126e..a37b3198 100644
--- a/src/ewins.c
+++ b/src/ewins.c
@@ -982,7 +982,7 @@ AddToFamily(EWin * ewin, EX_Window xwin, XWindowAttributes 
* pxwa, int startup)
        EwinOpFloatAt(ewin, OPSRC_USER, x, y);
        EwinShow(ewin);
        Mode.place.doing_manual = ewin;
-       MoveResizeMoveStart(ewin, 0, 0, 0);
+       MoveResizeMoveStart(ewin, 0, 0);
      }
    else if (doslide)
      {
diff --git a/src/ewins.h b/src/ewins.h
index 156e5407..0bc928a2 100644
--- a/src/ewins.h
+++ b/src/ewins.h
@@ -495,8 +495,7 @@ void                EwinSyncRequestWait(EWin * ewin);
 #endif
 
 /* moveresize.c */
-void                MoveResizeMoveStart(EWin * ewin, int kbd, int constrained,
-                                       int nogroup);
+void                MoveResizeMoveStart(EWin * ewin, int kbd, int nogroup);
 void                MoveResizeResizeStart(EWin * ewin, int kbd, int hv);
 
 void                MoveResizeSuspend(void);
diff --git a/src/ewmh.c b/src/ewmh.c
index 2c89e6f7..868ec776 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2021 Kim Woelders
+ * Copyright (C) 2003-2022 Kim Woelders
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
@@ -1033,14 +1033,14 @@ EWMH_ProcessClientClientMessage(EWin * ewin, 
XClientMessageEvent * ev)
             break;
 
          case _NET_WM_MOVERESIZE_MOVE:
-            MoveResizeMoveStart(ewin, 0, 0, 0);
+            MoveResizeMoveStart(ewin, 0, 0);
             break;
 
          case _NET_WM_MOVERESIZE_SIZE_KEYBOARD:
             MoveResizeResizeStart(ewin, 1, MODE_RESIZE);
             break;
          case _NET_WM_MOVERESIZE_MOVE_KEYBOARD:
-            MoveResizeMoveStart(ewin, 1, 0, 0);
+            MoveResizeMoveStart(ewin, 1, 0);
             break;
          case _NET_WM_MOVERESIZE_CANCEL:
             MoveResizeEnd(ewin);
diff --git a/src/ipc.c b/src/ipc.c
index 30571186..372e26fc 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -398,14 +398,6 @@ IPC_WinList(const char *params)
    Efree(lst);
 }
 
-#if 0                          /* TBD */
-static int
-doMoveConstrained(EWin * ewin, const char *params)
-{
-   return MoveResizeMoveStart(ewin, 0, params, 1, 0);
-}
-#endif
-
 static Timer       *op_timer = NULL;
 
 static int
@@ -609,11 +601,11 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm)
          }
        if (!strcmp(param1, "ptr"))
          {
-            MoveResizeMoveStart(ewin, 0, 0, Mode.nogroup);
+            MoveResizeMoveStart(ewin, 0, Mode.nogroup);
          }
        else if (!strcmp(param1, "kbd"))
          {
-            MoveResizeMoveStart(ewin, 1, 0, Mode.nogroup);
+            MoveResizeMoveStart(ewin, 1, Mode.nogroup);
          }
        else if (!strcmp(param1, "?"))
          {
diff --git a/src/moveresize.c b/src/moveresize.c
index c1a63709..8670a628 100644
--- a/src/moveresize.c
+++ b/src/moveresize.c
@@ -84,7 +84,7 @@ _MoveResizeGrabsSet(int kbd, unsigned int csr)
 }
 
 void
-MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, int nogroup)
+MoveResizeMoveStart(EWin * ewin, int kbd, int nogroup)
 {
    EWin              **gwins;
    int                 i, num, cx, cy;
@@ -104,7 +104,6 @@ MoveResizeMoveStart(EWin * ewin, int kbd, int constrained, 
int nogroup)
    SoundPlay(SOUND_MOVE_START);
 
    Mode.mode = MODE_MOVE_PENDING;
-   Mode.constrained = constrained;
 
    Mode_mr.start_x = Mode_mr.cur_x = cx;
    Mode_mr.start_y = Mode_mr.cur_y = cy;
@@ -475,7 +474,6 @@ _MoveResizeMoveHandleMotion(void)
    EWin               *ewin, **gwins, *ewin1;
    int                 i, num;
    int                 ndx, ndy;
-   int                 screen_snap_dist;
    char                jumpx, jumpy;
    int                 min_dx, max_dx, min_dy, max_dy;
 
@@ -574,10 +572,6 @@ _MoveResizeMoveHandleMotion(void)
    else
       ndy = min_dy;
 
-   screen_snap_dist =
-      Mode.constrained ? (WinGetW(VROOT) +
-                         WinGetH(VROOT)) : Conf.snap.screen_snap_dist;
-
    for (i = 0; i < num; i++)
      {
        ewin1 = gwins[i];
@@ -588,9 +582,9 @@ _MoveResizeMoveHandleMotion(void)
           dd = -dd;
        if ((ndx != dx) &&
            (((ewin1->shape_x == 0) &&
-             (dd > screen_snap_dist)) ||
+             (dd > Conf.snap.screen_snap_dist)) ||
             ((ewin1->shape_x == (WinGetW(VROOT) - EoGetW(ewin1))) &&
-             (dd > screen_snap_dist)) ||
+             (dd > Conf.snap.screen_snap_dist)) ||
             ((ewin1->shape_x != 0) &&
              (ewin1->shape_x != (WinGetW(VROOT) - EoGetW(ewin1)) &&
               (dd > Conf.snap.edge_snap_dist)))))
@@ -605,9 +599,9 @@ _MoveResizeMoveHandleMotion(void)
           dd = -dd;
        if ((ndy != dy) &&
            (((ewin1->shape_y == 0) &&
-             (dd > screen_snap_dist)) ||
+             (dd > Conf.snap.screen_snap_dist)) ||
             ((ewin1->shape_y == (WinGetH(VROOT) - EoGetH(ewin1))) &&
-             (dd > screen_snap_dist)) ||
+             (dd > Conf.snap.screen_snap_dist)) ||
             ((ewin1->shape_y != 0) &&
              (ewin1->shape_y != (WinGetH(VROOT) - EoGetH(ewin1)) &&
               (dd > Conf.snap.edge_snap_dist)))))

-- 


Reply via email to