Re: PATCH: Fix "invisible wall" problem with relative mouse mode



On Tue, Feb 24, 2009 at 08:25:33AM -0600, Anthony Liguori wrote:
> Daniel P. Berrange wrote:
> >A number of bugs have conspired together to make relative mouse mode not
> >work very well. The core problem is that when using the relative mode the
> >mouse pointer will appear to hit an "invisible wall" before the true edge
> >of the screen.
> >
> >The problems start occur when we do the mouse grab and fall out from 
> >that...
> >
> > - We passed our window as the "confine-to" arg for the gdk_pointer_grab.
> >   This meant that the client desktop pointer would stop moving / 
> >   generating
> >   events when we hit the edge of our window. In relative mode we need to
> >   get continuous events no matter where the pointer is, since we're after
> >   relative changes, not absolute coords.
> >  
> 
> What is supposed to fix this is auto warping.  If you detect that you're 
> close to the edge of the screen, it should warp you toward the center of 
> the window.
> 
> When I first implemented this, I observed that confining the pointer to 
> the desktop instead of the window merely made the problem harder to 
> reproduce.  You still stop getting pointer events if the mouse hits the 
> edge of the screen so under the right circumstances, you'll still hit a 
> wall.
> 
> The warping was supposed to be the proper fix although apparently it's 
> not working well enough.

The warping *does* in fact work perfectly, but only if you allow the mouse
to move  outside the VNC window. So this patch should enable the behaviour 
you originally intended. If we confined the pointer to just the VNC 
window, then we would have to change the warping code to watch for hitting
the edge of the VNC widget instead of edge of the screen. 

To test this was actually working, I tweaked the grab so that the local
cursor was not hidden while grabbed - this lets you see when it hits
the edge and that it warps back away from it

Daniel
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]