On 14 Nov 2002 08:52, Claude Lecommandeur wrote:
> 
>    Hello,
> 
> 
>    You are right, this is a plain bug. If no one else do it, I'll try to find
> some time to fix it.

I looked for it a bit today, but since I didn't know exactly where to
look I didn't find it. Have you had time to look for it?


I did however change the behavior of DontMoveOff/MoveOffResistance.
Currently the behavior of CTWM if you have set DontMoveOff and set a
MoveOffResistance is to prevent the window from being moved off until
you have moved the window #MoveOffResistance pixels outside the
screen, at which time the window snaps to the position it "should" be
in had DontMoveOff not been defined. What this means is that if you
have set a MoveOffResistance to 25, no part of the window can be moved
off the screen less than 25 pixels.

I find that often when I want to move a window partially off-screen, I
only want to move it a little bit off the screen, but to accomplish
this I often end up using force move.

My patch below changes the behavior of DontMoveOff/MoveOffResistance
so that when you attempt to move a window off screen, it will not move
at all until it's been moved #MoveOffResistance pixels (as before),
but at this time it will no longer "snap", but instead it will start
moving off screen. This means that you still have the old behavior of
DontMoveOff, but now with the ability to move a window off screen less
that #MoveOffResistance pixels.

If I find the time over the holidays I'll try to implement similar
functionality for MovePack.

(I noticed some code in workmgr.c that also seemed to make use of the
MoveOffResistance, but I didn't change that. I assume that this code
is for moving windows from within the workspacemanager. I didn't touch
this code.)

--

I've put up a page with both of my currently unapplied CTWM patches at
http://www.cis.upenn.edu/~bjornk/ctwm/

/Björn

Web: http://www.cis.upenn.edu/~bjornk/

diff -rwc ctwm-3.6/util.c /usr/local/src/ctwm-3.6/util.c
*** ctwm-3.6/util.c     2001-12-11 10:38:52.000000000 -0500
--- /usr/local/src/ctwm-3.6/util.c      2002-12-15 16:33:13.000000000 -0500
***************
*** 64,69 ****
--- 64,76 ----
   *
   * 22-April-92 Claude Lecommandeur.
   *
+  * Changed behavior of DontMoveOff/MoveOffResistance to allow
+  * moving a window off screen less than #MoveOffResistance pixels.
+  * New code will no longer "snap" windows to #MoveOffResistance
+  * pixels off screen and instead movements will just be stopped and
+  * then resume once movement of #MoveOffResistance have been attempted.
+  *
+  * 15-December-02 Bjorn Knutsson 
   *
   ***********************************************************************/
  
***************
*** 3972,3982 ****
  int *value;
  int border;
  {
!     if (*value < border &&
!         (Scr->MoveOffResistance < 0 ||
!          *value > border - Scr->MoveOffResistance))
      {
          *value = border;
      }
  }
  
--- 3979,3994 ----
  int *value;
  int border;
  {
!   if (*value < border) {
!     if (Scr->MoveOffResistance < 0 ||
!       *value > border - Scr->MoveOffResistance)
      {
          *value = border;
+     } else if (Scr->MoveOffResistance > 0 &&
+              *value <= border - Scr->MoveOffResistance)
+     {
+       *value = *value + Scr->MoveOffResistance;
+     }
    }
  }
  
***************
*** 3986,3996 ****
  int border;
  int size2;
  {
!     if (*value + size1 > size2 - border &&
!         (Scr->MoveOffResistance < 0 ||
!          *value + size1 < size2 - border + Scr->MoveOffResistance))
      {
          *value = size2 - size1 - border;
      }
  }
  
--- 3998,4012 ----
  int border;
  int size2;
  {
!     if (*value + size1 > size2 - border) {
!       if (Scr->MoveOffResistance < 0 ||
!          *value + size1 < size2 - border + Scr->MoveOffResistance)
        {
          *value = size2 - size1 - border;
+       } else if (Scr->MoveOffResistance > 0 &&
+                  *value + size1 >= size2 - border + Scr->MoveOffResistance) {
+         *value = *value - Scr->MoveOffResistance;
+       }
      }
  }

Reply via email to