[ctwm] Weird Warping behaviour

2007-12-30 Thread Rhialto
If you use the warp ring to warp to a window (but probably also in other
cases of warping), the mouse seems to be moved a bit down and to the
right of the location where it should be. For me it is offset by (2,2),
I think that is likely the border width.

You can see it if you are in a workspace with only 2 windows, and warp
repeatedly between them. Start near the lower right corner in one of
them to make it most obvious. Pretty soon you'll be moving into the
corner.

Relevant settings in my .ctwmrc:

define(HRDWNDWMETA, m4)dnl

WarpRingOnScreen
Tab   = HRDWNDWMETA: all : f.warpring next

Either the recording of the previous position is incorrect in
menus.c:WarpAlongRing(), 

p-ring.cursor_valid = True;
p-ring.curs_x = ev-x_root - t-frame_x;
p-ring.curs_y = ev-y_root - t-frame_y;

or XWarpPointer(3X11) in menus.c:WarpToWindow()

XWarpPointer (dpy, None, t-frame, 0, 0, 0, 0, x, y);

adds some offset (but that seems fairly unlikely).

In the back of my mind is some memory about how windows with plain or 3D
borders have different coordinate systems - that might be related. Maybe
it is time to overhaul that (which I haven't done since it seems tricky
to get that right).


{{{ aside:
when using f.movetonextworkspaceandfollow, the
SaveWorkspaceFocus option should not operate!
}}}

Hopefully more later.
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.



[ctwm] Re: Weird Warping behaviour

2007-12-30 Thread Rhialto
On Sun 30 Dec 2007 at 15:44:20 +0100, Rhialto wrote:
 XWarpPointer (dpy, None, t-frame, 0, 0, 0, 0, x, y);
 
 adds some offset (but that seems fairly unlikely).

except that it does. The origin of a Window is apparently inside the
Window's border. I had to look that up, such things are not in manpages.

So that was easily fixed. My next question is: can I know if the
position we're going to move the mouse to is actually visible (not
obscured)? (because, if the pointer is actually in the correct window we
need not raise it)

I discussed this with someone and they suggested the only possible way
would be to await the next EnterNotify message, and if it wasn't for the
desired window, raise it.

I'd rather not do that if I can avoid it, the state machine is quite
complicated enough as it is. But does anyone have a better idea?

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.