Re: Nasty user mouse/keyboard move & resizing bugs from pointer warping



On 10/28/05, BJörn Lindqvist <bjourne gmail com> wrote:
> > Yeah, I've been bothered a number of times by the pointer warping when
> > I wasn't using the mouse at all.  I'd love to fix this issue
> > too--though I think we may want the mouse to still be warped in some
> > cases (e.g. if the user is moving the window and moves it far enough
> > and the pointer was in the window to begin with).
>
> Yes. Although I think that in the alt+f7 case, warping the pointer
> might not be needed.

Might not be, but I think it depends on whether the mouse started in
the window before it was moved and the window was moved far enough
that the mouse didn't stay inside it.

> > I'd like to do this, but I don't see how it's possible with X.  If
> > anyone knows better than me, I'd love to hear it.
>
> I found this thread on google
> (http://groups.google.se/group/comp.windows.x/browse_thread/thread/36c5a9b53c0b8ff1/00489bfc5f6d9941?lnk=st&q=XWarpPointer&rnum=7&hl=sv#00489bfc5f6d9941):
>
> "You could remove MotionNotify from your event mask during the time
> you do the warp, then put it back, but that may have performance
> implications."
>
> And also this code by googling for PointerMotionMask:
>
> ...
> XSelectInput( x_disp, x_win, STD_EVENT_MASK & ~PointerMotionMask );
> XWarpPointer( x_disp, None, x_win, 0, 0, 0, 0, (window_width / 2),
> (window_height / 2) );
> XSelectInput( x_disp, x_win, STD_EVENT_MASK );
> ....

It looks like it might be a nasty race condition to me, but I'm not
familiar enough with X to know for sure.  It's possible it makes
things even less problematic, though...

> > I'm not sure what you are referring to with the "issue with
> > shift+moving" the mouse, but I fixed one or two such issues on the
> > constraints_experiments branch.  Could you try it out and let me know
> > if the problem you're referring to is still an issue with that
> > version?
>
> I've checked it out now. It seems like that in that branch most issues
> with Alt+F7 and Alt+F8 has been fixed. But not the issue with
> shift+mouse moving. The mouse thing I'm referring to is that when you
> first press Alt+F7 and then shift+moving the mouse, the window is
> always moved to screen edge. I think it should work so that when you
> move the mouse left for example, the window should move to the left
> border but its y-position should stay the same. I think that is the
> bug you are referring to here:
> http://bugzilla.gnome.org/show_bug.cgi?id=124582#c3 But that may be a
> completey different issue since it is not caused by XWarpPointer().

Works just fine for me and I did indeed fix that specific issue--at
least to my ability to test.  It's possible that I missed some kind of
case you're triggering, but it's also possible that your mouse is one
of those that's nearly impossible to move unidirectionally (it's kind
of hard to do with my mouse too and probably for most mice...).

However, perhaps there's a bigger issue in that we should introduce
some threshold before snapping with mouse movement?  Currently, the
threshold is basically 1 so that it snaps if there is any movement
whatsoever in the given direction.

Cheers,
Elijah



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