xserver: Branch 'master' - 7 commits

Jon TURNEY jturney at kemper.freedesktop.org
Wed Dec 17 05:41:28 PST 2008


 hw/xwin/InitInput.c               |   19 +++++++-------
 hw/xwin/InitOutput.c              |   17 ------------
 hw/xwin/Makefile.am               |    1 
 hw/xwin/win.h                     |    8 +++++
 hw/xwin/wincursor.c               |   33 +++++++++++++++++-------
 hw/xwin/winkeybd.c                |   20 ++++++++------
 hw/xwin/winmouse.c                |   51 ++++++++++++++++++++++++++++++--------
 hw/xwin/winmultiwindowwm.c        |    7 +++--
 hw/xwin/winmultiwindowwndproc.c   |   10 +++----
 hw/xwin/winscrinit.c              |   32 ++++++++++++++++++++---
 hw/xwin/winshaddd.c               |    2 -
 hw/xwin/winshadddnl.c             |    2 -
 hw/xwin/winshadgdi.c              |    2 -
 hw/xwin/winwin32rootlesswndproc.c |    6 ++--
 hw/xwin/winwndproc.c              |   12 +++-----
 15 files changed, 144 insertions(+), 78 deletions(-)

New commits:
commit 1556815d34cecb4b4b62d2a4ce813b1435a937ec
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:18 2008 +0000

    Cygwin/X: Initialize native HWND atom when built !XWIN_MULTIWINDOWEXTWM
    
    Fix the native HWND atom identifier to be initialized correctly, when built without external WM support
    
    This is neccessary for native window naming to work correctly in multiwindow internal WM mode.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 126ecc6..7e00fb8 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -58,6 +58,10 @@
 #include "winwindow.h"
 #ifdef XWIN_MULTIWINDOWEXTWM
 #include "windowswmstr.h"
+#else
+/* We need the native HWND atom for intWM, so for consistency use the
+   same name as extWM would if we were building with enabled... */
+#define WINDOWSWM_NATIVE_HWND "_WINDOWSWM_NATIVE_HWND"
 #endif
 
 extern void winDebug(const char *format, ...);
@@ -1256,11 +1260,10 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
   pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
 				      "WM_DELETE_WINDOW",
 				      False);
-#ifdef XWIN_MULTIWINDOWEXTWM
+
   pWMInfo->atmPrivMap  = XInternAtom (pWMInfo->pDisplay,
 				      WINDOWSWM_NATIVE_HWND,
 				      False);
-#endif
 
 
   if (1) {
commit 92082a0a00f05ecdc90814a8104828853c9c8f29
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:15 2008 +0000

    Cygwin/X: update to use standard DPMS stubs
    
    Bring Cygwin/X up to date with DPMS API changes by using the standard stubs
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index abc35b9..291593b 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -1120,20 +1120,3 @@ winCheckDisplayNumber ()
 
   return TRUE;
 }
-
-#ifdef DPMSExtension
-Bool DPMSSupported(void)
-{
-  return FALSE;
-}
-
-void DPMSSet(int level)
-{
-  return;
-}
-
-int DPMSGet(int *plevel)
-{
-  return 0;
-}
-#endif
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 3c6b963..504c2a6 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -120,6 +120,7 @@ SRCS =	InitInput.c \
 	winresource.h \
 	winwindow.h \
 	XWin.rc \
+	$(top_srcdir)/Xext/dpmsstubs.c \
 	$(top_srcdir)/Xi/stubs.c \
 	$(top_srcdir)/mi/miinitext.c \
 	$(top_srcdir)/fb/fbcmap_mi.c \
commit 2850f26bb2999ef3fb2a10adb80fe358463aecb5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:14 2008 +0000

    Cygwin/X: update for changes to shadow framebuffer
    
    Bring Cygwin/X up to date with the change to damage-based shadow framebuffer.
    
    Register the screen bitmap as the shadow framebuffer after screen resources
    are created.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 5904a65..33b7469 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -313,6 +313,7 @@ typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
 
 typedef Bool (*winFinishCreateWindowsWindowProcPtr)(WindowPtr pWin);
 
+typedef Bool (*winCreateScreenResourcesProc)(ScreenPtr);
 
 /* Typedef for DIX wrapper functions */
 typedef int (*winDispatchProcPtr) (ClientPtr);
@@ -563,6 +564,8 @@ typedef struct _winPrivScreenRec
   winCreatePrimarySurfaceProcPtr	pwinCreatePrimarySurface;
   winReleasePrimarySurfaceProcPtr	pwinReleasePrimarySurface;
 
+  winCreateScreenResourcesProc       pwinCreateScreenResources;
+
 #ifdef XWIN_MULTIWINDOW
   /* Window Procedures for MultiWindow mode */
   winFinishCreateWindowsWindowProcPtr	pwinFinishCreateWindowsWindow;
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index ee3c78b..96778ab 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -244,6 +244,25 @@ winScreenInit (int index,
   return TRUE;
 }
 
+static Bool
+winCreateScreenResources(ScreenPtr pScreen)
+{
+  winScreenPriv(pScreen);
+  Bool result;
+
+  result = pScreenPriv->pwinCreateScreenResources(pScreen);
+
+  /* Now the screen bitmap has been wrapped in a pixmap,
+     add that to the Shadow framebuffer */
+  if (!shadowAdd(pScreen, pScreen->devPrivate,
+		 pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
+    {
+      ErrorF ("winCreateScreenResources - shadowAdd () failed\n");
+      return FALSE;
+    }
+
+  return result;
+}
 
 /* See Porting Layer Definition - p. 20 */
 Bool
@@ -427,15 +446,18 @@ winFinishScreenInitFB (int index,
       )
     {
 #if CYGDEBUG
-      winDebug ("winFinishScreenInitFB - Calling shadowInit ()\n");
+      winDebug ("winFinishScreenInitFB - Calling shadowSetup ()\n");
 #endif
-      if (!shadowInit (pScreen,
-		       pScreenPriv->pwinShadowUpdate,
-		       NULL))
+      if (!shadowSetup(pScreen))
 	{
-	  ErrorF ("winFinishScreenInitFB - shadowInit () failed\n");
+	  ErrorF ("winFinishScreenInitFB - shadowSetup () failed\n");
 	  return FALSE;
 	}
+
+      /* Wrap CreateScreenResources so we can add the screen pixmap
+         to the Shadow framebuffer after it's been created */
+      pScreenPriv->pwinCreateScreenResources = pScreen->CreateScreenResources;
+      pScreen->CreateScreenResources = winCreateScreenResources;
     }
 
 #ifdef XWIN_MULTIWINDOWEXTWM
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index a2c1dc9..5f5daeb 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -508,7 +508,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
 {
   winScreenPriv(pScreen);
   winScreenInfo		*pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr		damage = &pBuf->damage;
+  RegionPtr		damage = shadowDamage(pBuf);
   HRESULT		ddrval = DD_OK;
   RECT			rcDest, rcSrc;
   POINT			ptOrigin;
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 47cc382..630c720 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -584,7 +584,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
 {
   winScreenPriv(pScreen);
   winScreenInfo		*pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr		damage = &pBuf->damage;
+  RegionPtr		damage = shadowDamage(pBuf);
   HRESULT		ddrval = DD_OK;
   RECT			rcDest, rcSrc;
   POINT			ptOrigin;
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 04cc2f7..d38e4f7 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -498,7 +498,7 @@ winShadowUpdateGDI (ScreenPtr pScreen,
 {
   winScreenPriv(pScreen);
   winScreenInfo		*pScreenInfo = pScreenPriv->pScreenInfo;
-  RegionPtr		damage = &pBuf->damage;
+  RegionPtr		damage = shadowDamage(pBuf);
   DWORD			dwBox = REGION_NUM_RECTS (damage);
   BoxPtr		pBox = REGION_RECTS (damage);
   int			x, y, w, h;
commit 35d76028304f910edeaf642376df71b8134ec02c
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:13 2008 +0000

    Cygwin/X: enqueue a pointer motion event on mouse movement
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 045577e..5904a65 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1005,6 +1005,9 @@ winMouseButtonsHandle (ScreenPtr pScreen,
 		       int iEventType, int iButton,
 		       WPARAM wParam);
 
+void
+winEnqueueMotion(int x, int y);
+
 #ifdef XWIN_NATIVEGDI
 /*
  * winnativegdi.c
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index 04a2ae1..188126b 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -344,3 +344,29 @@ winMouseButtonsHandle (ScreenPtr pScreen,
 
   return 0;
 }
+
+/**
+ * Enqueue a motion event.
+ *
+ *  XXX: miPointerMove does exactly this, but is static :-( (and uses a static buffer)
+ *
+ */
+void winEnqueueMotion(int x, int y)
+{
+  miPointerSetPosition(g_pwinPointer, &x, &y);
+  g_c32LastInputEventTime = GetTickCount();
+
+  int i, nevents;
+  int valuators[2];
+
+  EventListPtr events;
+  GetEventList(&events);
+
+  valuators[0] = x;
+  valuators[1] = y;
+  nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
+			     POINTER_ABSOLUTE, 0, 2, valuators);
+
+  for (i = 0; i < nevents; i++)
+    mieqEnqueue(g_pwinPointer, events[i].event);
+}
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index d7fc122..8eadf45 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -535,9 +535,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
 	}
 
       /* Deliver absolute cursor position to X Server */
-      miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
-			       ptMouse.y - s_pScreenInfo->dwYOffset,
-			       g_c32LastInputEventTime = GetTickCount ());
+      winEnqueueMotion(ptMouse.x - s_pScreenInfo->dwXOffset,
+		       ptMouse.y - s_pScreenInfo->dwYOffset);
+
       return 0;
       
     case WM_NCMOUSEMOVE:
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 32db662..6518469 100755
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -571,9 +571,9 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
 	}
 
       /* Deliver absolute cursor position to X Server */
-      miPointerAbsoluteCursor (ptMouse.x - pScreenInfo->dwXOffset,
-			       ptMouse.y - pScreenInfo->dwYOffset,
-			       g_c32LastInputEventTime = GetTickCount ());
+      winEnqueueMotion(ptMouse.x - pScreenInfo->dwXOffset,
+		       ptMouse.y - pScreenInfo->dwYOffset);
+
       return 0;
       
     case WM_NCMOUSEMOVE:
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 66f439f..460efe6 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -764,9 +764,8 @@ winWindowProc (HWND hwnd, UINT message,
 	}
       
       /* Deliver absolute cursor position to X Server */
-      miPointerAbsoluteCursor (GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
-			       GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset,
-			       g_c32LastInputEventTime = GetTickCount ());
+      winEnqueueMotion(GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
+		       GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
       return 0;
 
     case WM_NCMOUSEMOVE:
@@ -929,8 +928,7 @@ winWindowProc (HWND hwnd, UINT message,
 	    point.y -= GetSystemMetrics (SM_YVIRTUALSCREEN);
 	    
 	    /* Deliver absolute cursor position to X Server */
-	    miPointerAbsoluteCursor (point.x, point.y,
-				     g_c32LastInputEventTime = GetTickCount());
+	    winEnqueueMotion(point.x , point.y);
 
 	    /* Check if a button was released but we didn't see it */
 	    GetCursorPos (&point);
commit 816e0d243df068bc06d328874b5655d4530fe16a
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:12 2008 +0000

    Cygwin/X: update for changes in mieq API
    
    Bring Cygwin/X up to date with mieq event API changes
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index d7e3f9c..76c1715 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -153,8 +153,7 @@ InitInput (int argc, char *argv[])
   g_pwinPointer->name = strdup("Windows mouse");
   g_pwinKeyboard->name = strdup("Windows keyboard");
 
-  miRegisterPointerDevice (screenInfo.screens[0], pMouse);
-  mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
+  mieqInit ();
 
   /* Initialize the mode key states */
   winInitializeModeKeyStates ();
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index d574f20..90cd5af 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -580,7 +580,8 @@ winKeybdReleaseKeys ()
 void
 winSendKeyEvent (DWORD dwKey, Bool fDown)
 {
-  xEvent			xCurrentEvent;
+  EventListPtr events;
+  int i, nevents;
 
   /*
    * When alt-tabing between screens we can get phantom key up messages
@@ -590,14 +591,17 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
 
   /* Update the keyState map */
   g_winKeyState[dwKey] = fDown;
-  
-  ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
 
-  xCurrentEvent.u.u.type = fDown ? KeyPress : KeyRelease;
-  xCurrentEvent.u.keyButtonPointer.time =
-    g_c32LastInputEventTime = GetTickCount ();
-  xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE;
-  mieqEnqueue (&xCurrentEvent);
+  GetEventList(&events);
+  nevents = GetKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE);
+
+  for (i = 0; i < nevents; i++)
+    mieqEnqueue(g_pwinKeyboard, events[i].event);
+
+#if CYGDEBUG
+  ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
+          dwKey, fDown, nevents);
+#endif
 }
 
 BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index be2b66a..04a2ae1 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -100,7 +100,6 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState)
       InitPointerDeviceStruct (pDevice,
 			       map,
 			       lngMouseButtons + lngWheelEvents,
-			       GetMotionHistory,
 			       winMouseCtrl,
 			       GetMotionHistorySize(),
 			       2);
@@ -221,19 +220,25 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
 void
 winMouseButtonsSendEvent (int iEventType, int iButton)
 {
-  xEvent		xCurrentEvent;
+  EventListPtr events;
+  int i, nevents;
 
-  /* Load an xEvent and enqueue the event */
-  xCurrentEvent.u.u.type = iEventType;
 #if defined(XFree86Server)
   if (g_winMouseButtonMap)
-    xCurrentEvent.u.u.detail = g_winMouseButtonMap[iButton];
-  else
+    iButton = g_winMouseButtonMap[iButton];
+#endif
+
+  GetEventList(&events);
+  nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton,
+			     POINTER_RELATIVE, 0, 0, NULL);
+
+  for (i = 0; i < nevents; i++)
+    mieqEnqueue(g_pwinPointer, events[i].event);
+
+#if CYGDEBUG
+  ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n",
+          iEventType, iButton, nevents);
 #endif
-  xCurrentEvent.u.u.detail = iButton;
-  xCurrentEvent.u.keyButtonPointer.time
-    = g_c32LastInputEventTime = GetTickCount ();
-  mieqEnqueue (&xCurrentEvent);
 }
 
 
commit bca7483c4e95ad450fb09048a3b85bb3056a0518
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:11 2008 +0000

    Cygwin/X: update for MPX device changes
    
    Bring Cygwin/X up to date with MPX device API changes
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index fd4f26f..d7e3f9c 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -49,6 +49,8 @@ DISPATCH_PROC(winProcSetSelectionOwner);
  */
 
 CARD32				g_c32LastInputEventTime = 0;
+DeviceIntPtr g_pwinPointer;
+DeviceIntPtr g_pwinKeyboard;
 
 
 /*
@@ -94,7 +96,6 @@ ProcessInputEvents (void)
 #endif
 
   mieqProcessInputEvents ();
-  miPointerUpdate ();
 
 #if 0
   ErrorF ("ProcessInputEvents - returning\n");
@@ -122,8 +123,6 @@ TimeSinceLastInputEvent ()
 void
 InitInput (int argc, char *argv[])
 {
-  DeviceIntPtr		pMouse, pKeyboard;
-
 #if CYGDEBUG
   winDebug ("InitInput\n");
 #endif
@@ -145,11 +144,14 @@ InitInput (int argc, char *argv[])
     }
 #endif
 
-  pMouse = AddInputDevice (winMouseProc, TRUE);
-  pKeyboard = AddInputDevice (winKeybdProc, TRUE);
+  g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE);
+  g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE);
   
-  RegisterPointerDevice (pMouse);
-  RegisterKeyboardDevice (pKeyboard);
+  RegisterPointerDevice (g_pwinPointer);
+  RegisterKeyboardDevice (g_pwinKeyboard);
+
+  g_pwinPointer->name = strdup("Windows mouse");
+  g_pwinKeyboard->name = strdup("Windows keyboard");
 
   miRegisterPointerDevice (screenInfo.screens[0], pMouse);
   mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 2faa67e..045577e 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -638,6 +638,8 @@ extern HINSTANCE		g_hInstance;
 extern int                      g_copyROP[];
 extern int                      g_patternROP[];
 extern const char *		g_pszQueryHost;
+extern DeviceIntPtr             g_pwinPointer;
+extern DeviceIntPtr             g_pwinKeyboard;
 
 
 /*
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 20ff9f7..d7fc122 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -495,8 +495,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
 	break;
 
       /* Has the mouse pointer crossed screens? */
-      if (s_pScreen != miPointerGetScreen(inputInfo.pointer))
-	miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen,
+      if (s_pScreen != miPointerGetScreen(g_pwinPointer))
+	miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen,
 			       ptMouse.x - s_pScreenInfo->dwXOffset,
 			       ptMouse.y - s_pScreenInfo->dwYOffset);
 
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 29ea81f..66f439f 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -724,8 +724,8 @@ winWindowProc (HWND hwnd, UINT message,
 	break;
 
       /* Has the mouse pointer crossed screens? */
-      if (s_pScreen != miPointerGetScreen(inputInfo.pointer))
-	miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen,
+      if (s_pScreen != miPointerGetScreen(g_pwinPointer))
+	miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen,
 			       GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
 			       GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
 
commit 829a8a970dd17623ef3cb5022d34190744f74741
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Nov 2 18:27:10 2008 +0000

    Cygwin/X: update for MPX cursor API changes
    
    Bring Cygwin/X up to date with cursor API changes
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index 92775e4..fcd156e 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -62,7 +62,7 @@ extern Bool	g_fSoftwareCursor;
  */
 
 static void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y);
+winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
 
 static Bool
 winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y);
@@ -79,7 +79,7 @@ miPointerScreenFuncRec g_winPointerCursorFuncs =
 
 
 static void
-winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
+winPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
   winScreenPriv(pScreen);
   RECT			rcClient;
@@ -119,7 +119,7 @@ winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
     }
 
   /* Call the mi warp procedure to do the actual warping in X. */
-  miPointerWarpCursor (pScreen, x, y);
+  miPointerWarpCursor (pDev, pScreen, x, y);
 }
 
 static Bool
@@ -436,7 +436,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
  *  Convert the X cursor representation to native format if possible.
  */
 static Bool
-winRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
+winRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
   if(pCursor == NULL || pCursor->bits == NULL)
     return FALSE;
@@ -452,7 +452,7 @@ winRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
  *  Free the storage space associated with a realized cursor.
  */
 static Bool
-winUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+winUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 {
   return TRUE;
 }
@@ -463,7 +463,7 @@ winUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
  *  Set the cursor sprite and position.
  */
 static void
-winSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+winSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 {
   POINT ptCurPos, ptTemp;
   HWND  hwnd;
@@ -537,20 +537,35 @@ winSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
 
 
 /*
- * QuartzMoveCursor
+ * winMoveCursor
  *  Move the cursor. This is a noop for us.
  */
 static void
-winMoveCursor (ScreenPtr pScreen, int x, int y)
+winMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
 }
 
+static Bool
+winDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr)
+{
+  winScreenPriv(pScr);
+  return pScreenPriv->cursor.spriteFuncs->DeviceCursorInitialize(pDev, pScr);
+}
+
+static void
+winDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr)
+{
+  winScreenPriv(pScr);
+  return pScreenPriv->cursor.spriteFuncs->DeviceCursorCleanup(pDev, pScr);
+}
 
 static miPointerSpriteFuncRec winSpriteFuncsRec = {
   winRealizeCursor,
   winUnrealizeCursor,
   winSetCursor,
-  winMoveCursor
+  winMoveCursor,
+  winDeviceCursorInitialize,
+  winDeviceCursorCleanup
 };
 
 


More information about the xorg-commit mailing list