xserver: Branch 'master' - 3 commits

Peter Hutterer whot at kemper.freedesktop.org
Thu Jan 15 22:22:39 PST 2009


 dix/events.c                           |  111 +++++++++------------------------
 hw/xfree86/os-support/linux/lnx_init.c |   60 +++++++----------
 2 files changed, 57 insertions(+), 114 deletions(-)

New commits:
commit b33905234025f005819c7e2acd653a3a0ecfeb82
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 9 14:32:14 2009 +1000

    xfree86: always force RAW mode under linux.
    
    The previous check for AEI on left us with the possibility that AEI is forced
    off in the config, but devices are added through evdev nonetheless. A keyboard
    added this way can CTRL+C the server. Even when we use kbd, we can set the
    mode to RAW, so it's safer alround to to so.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
index 0ac97e8..17502a1 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -250,6 +250,8 @@ xf86OpenConsole(void)
 
         if (!ShareVTs)
         {
+            struct termios nTty;
+
 #if defined(DO_OS_FONTRESTORE)
 	    lnx_savefont();
 #endif
@@ -282,37 +284,27 @@ xf86OpenConsole(void)
 	        FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
 		           strerror(errno));
 
-	    /* Set the keyboard to RAW mode. If we're using the keyboard
-	     * driver, the driver does it for us. If we have AEI on, then
-	     * we're expecting the devices to be added (i.e. evdev) and we
-	     * have to set it manually.
-	     */
-	    if (xf86Info.allowEmptyInput)
-	    {
-		struct termios nTty;
-
-		tcgetattr(xf86Info.consoleFd, &tty_attr);
-		ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
-
-		if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0)
-		    FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
-			    strerror(errno));
-
-		nTty = tty_attr;
-		nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
-		nTty.c_oflag = 0;
-		nTty.c_cflag = CREAD | CS8;
-		nTty.c_lflag = 0;
-		nTty.c_cc[VTIME]=0;
-		nTty.c_cc[VMIN]=1;
-		cfsetispeed(&nTty, 9600);
-		cfsetospeed(&nTty, 9600);
-		tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
-
-		/* need to keep the buffer clean, else the kernel gets angry */
-		console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
-							drain_console, NULL);
-	    }
+            tcgetattr(xf86Info.consoleFd, &tty_attr);
+            ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
+
+            if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0)
+                FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
+                        strerror(errno));
+
+            nTty = tty_attr;
+            nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
+            nTty.c_oflag = 0;
+            nTty.c_cflag = CREAD | CS8;
+            nTty.c_lflag = 0;
+            nTty.c_cc[VTIME]=0;
+            nTty.c_cc[VMIN]=1;
+            cfsetispeed(&nTty, 9600);
+            cfsetospeed(&nTty, 9600);
+            tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
+
+            /* need to keep the buffer clean, else the kernel gets angry */
+            console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
+                    drain_console, NULL);
 
 	    /* we really should have a InitOSInputDevices() function instead
 	     * of Init?$#*&Device(). So I just place it here */
@@ -376,10 +368,8 @@ xf86CloseConsole(void)
 	xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n",
 		strerror(errno));
 
-    if (xf86Info.allowEmptyInput) {
-	ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
-	tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
-    }
+    ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
+    tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
 
     if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) 
 	xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n",
commit 646add4eb47c01c045ef64405510a08ecfb5bfd6
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 16 16:04:07 2009 +1000

    dix: remove XineramaCheckMotion, merge into CheckMotion.
    
    For 5 lines difference, we don't need to duplicate the whole function. really.

diff --git a/dix/events.c b/dix/events.c
index 0a1d34c..a1aec2f 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -611,66 +611,6 @@ XineramaCheckVirtualMotion(
     }
 }
 
-
-static Bool
-XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev)
-{
-    WindowPtr prevSpriteWin;
-    SpritePtr pSprite = pDev->spriteInfo->sprite;
-
-    prevSpriteWin = pSprite->win;
-
-    if (xE && !syncEvents.playingEvents)
-    {
-	/* Motion events entering DIX get translated to Screen 0
-	   coordinates.  Replayed events have already been
-	   translated since they've entered DIX before */
-	XE_KBPTR.rootX += panoramiXdataPtr[pSprite->screen->myNum].x -
-			  panoramiXdataPtr[0].x;
-	XE_KBPTR.rootY += panoramiXdataPtr[pSprite->screen->myNum].y -
-			  panoramiXdataPtr[0].y;
-	pSprite->hot.x = XE_KBPTR.rootX;
-	pSprite->hot.y = XE_KBPTR.rootY;
-	if (pSprite->hot.x < pSprite->physLimits.x1)
-	    pSprite->hot.x = pSprite->physLimits.x1;
-	else if (pSprite->hot.x >= pSprite->physLimits.x2)
-	    pSprite->hot.x = pSprite->physLimits.x2 - 1;
-	if (pSprite->hot.y < pSprite->physLimits.y1)
-	    pSprite->hot.y = pSprite->physLimits.y1;
-	else if (pSprite->hot.y >= pSprite->physLimits.y2)
-	    pSprite->hot.y = pSprite->physLimits.y2 - 1;
-
-	if (pSprite->hotShape)
-	    ConfineToShape(pDev, pSprite->hotShape, &pSprite->hot.x, &pSprite->hot.y);
-
-	pSprite->hotPhys = pSprite->hot;
-	if ((pSprite->hotPhys.x != XE_KBPTR.rootX) ||
-	    (pSprite->hotPhys.y != XE_KBPTR.rootY))
-	{
-	    XineramaSetCursorPosition(
-			pDev, pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
-	}
-	XE_KBPTR.rootX = pSprite->hot.x;
-	XE_KBPTR.rootY = pSprite->hot.y;
-    }
-
-    pSprite->win = XYToWindow(pDev, pSprite->hot.x, pSprite->hot.y);
-
-    if (pSprite->win != prevSpriteWin)
-    {
-	if (prevSpriteWin != NullWindow) {
-	    if (!xE)
-		UpdateCurrentTimeIf();
-            DoEnterLeaveEvents(pDev, prevSpriteWin, pSprite->win,
-                               NotifyNormal);
-        }
-	PostNewCursor(pDev);
-        return FALSE;
-    }
-    return TRUE;
-}
-
-
 static void
 XineramaConfineCursorToWindow(DeviceIntPtr pDev,
                               WindowPtr pWin,
@@ -2616,11 +2556,6 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
 
     prevSpriteWin = pSprite->win;
 
-#ifdef PANORAMIX
-    if(!noPanoramiXExtension)
-	return XineramaCheckMotion(xE, pDev);
-#endif
-
     if (xE && !syncEvents.playingEvents)
     {
         /* GetPointerEvents() guarantees that pointer events have the correct
@@ -2646,11 +2581,27 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
                 return FALSE;
         }
 
-        if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen)
+
+#ifdef PANORAMIX
+        if (!noPanoramiXExtension)
         {
-            pSprite->hot.pScreen = pSprite->hotPhys.pScreen;
-            RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
+            /* Motion events entering DIX get translated to Screen 0
+               coordinates.  Replayed events have already been
+               translated since they've entered DIX before */
+            *rootX += panoramiXdataPtr[pSprite->screen->myNum].x -
+                                       panoramiXdataPtr[0].x;
+            *rootY += panoramiXdataPtr[pSprite->screen->myNum].y -
+                                       panoramiXdataPtr[0].y;
+        } else
+#endif
+        {
+            if (pSprite->hot.pScreen != pSprite->hotPhys.pScreen)
+            {
+                pSprite->hot.pScreen = pSprite->hotPhys.pScreen;
+                RootWindow(pDev) = WindowTable[pSprite->hot.pScreen->myNum];
+            }
         }
+
         pSprite->hot.x = *rootX;
         pSprite->hot.y = *rootY;
         if (pSprite->hot.x < pSprite->physLimits.x1)
@@ -2668,9 +2619,18 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
 	if ((pSprite->hotPhys.x != *rootX) ||
 	    (pSprite->hotPhys.y != *rootY))
 	{
-	    (*pSprite->hotPhys.pScreen->SetCursorPosition)(
-                pDev, pSprite->hotPhys.pScreen,
-		pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
+#ifdef PANORAMIX
+            if (!noPanoramiXExtension)
+            {
+                XineramaSetCursorPosition(
+                        pDev, pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
+            } else
+#endif
+            {
+                (*pSprite->hotPhys.pScreen->SetCursorPosition)(
+                        pDev, pSprite->hotPhys.pScreen,
+                        pSprite->hotPhys.x, pSprite->hotPhys.y, FALSE);
+            }
 	}
 
 	*rootX = pSprite->hot.x;
commit e76f904abe530df9ddaa09510088c545298b0b91
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 16 15:53:50 2009 +1000

    dix: remove "notyet" conditional compilation.
    
    If it's "notyet" for 3 years, then "yet" won't arive anytime soon.

diff --git a/dix/events.c b/dix/events.c
index e23cf8f..0a1d34c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2678,14 +2678,7 @@ CheckMotion(xEvent *xE, DeviceIntPtr pDev)
     }
 
     pSprite->win = XYToWindow(pDev, pSprite->hot.x, pSprite->hot.y);
-#ifdef notyet
-    if (!(pSprite->win->deliverableEvents &
-	  Motion_Filter(pDev->button))
-	!syncEvents.playingEvents)
-    {
-	/* XXX Do PointerNonInterestBox here */
-    }
-#endif
+
     if (pSprite->win != prevSpriteWin)
     {
 	if (prevSpriteWin != NullWindow) {


More information about the xorg-commit mailing list