[PATCH] Replace miPointerCurrentScreen with miPointerGetScreen.

Jamey Sharp jamey at minilop.net
Fri Oct 2 14:54:57 PDT 2009


On Fri, Oct 02, 2009 at 11:36:34PM +0200, Julien Cristau wrote:
> On Fri, Oct  2, 2009 at 13:42:48 -0700, Jamey Sharp wrote:
> > @@ -307,7 +307,7 @@ xf86RandRSetConfig (ScreenPtr		pScreen,
> >      /*
> >       * Move the cursor back where it belongs; SwitchMode repositions it
> >       */
> > -    if (pScreen == miPointerCurrentScreen ())
> > +    if (pScreen == miPointerGetScreen (inputInfo.pointer))
> >      {
> >  	px = (px >= pScreen->width ? (pScreen->width - 1) : px);
> >  	py = (py >= pScreen->height ? (pScreen->height - 1) : py);
> 
> Should this loop over the master pointers instead?

I get the impression from glancing at the code that you're right, but
xf86RandRSetConfig begins with

	miPointerGetPosition(inputInfo.pointer, &px, &py);

and this if block ends with

	(*pScreen->SetCursorPosition) (inputInfo.pointer, pScreen, ...

so there's quite a bit more involved in such a change.

Meanwhile, this simple patch at least makes this call consistent with
the two near it, and fixes the compiler warning.

I suspect most of this code could go away anyway, in a world where
people rarely use viewport panning. I'd guess the real problem is that
xf86SwitchMode goes to a bunch of trouble to move all the pointers
around and then this function feebly attempts to put one of them back.

Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.x.org/archives/xorg-devel/attachments/20091002/20275804/attachment.pgp 


More information about the xorg-devel mailing list