Index: /trunk/src/gui/kernel/qcursor_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qcursor_pm.cpp	(revision 479)
+++ /trunk/src/gui/kernel/qcursor_pm.cpp	(revision 480)
@@ -56,4 +56,7 @@
 
 extern QCursorData *qt_cursorTable[Qt::LastCursor + 1]; // qcursor.cpp
+
+extern HPS qt_alloc_mem_ps(int w, int h, HPS compat = 0); // qpixmap_pm.cpp
+extern void qt_free_mem_ps(HPS hps); // qpixmap_pm.cpp
 
 /*****************************************************************************
@@ -292,5 +295,5 @@
 "                        "};
 
-enum { cursor_whatsthis_x = 9, cursor_whatsthis_y = 0 };
+enum { cursor_whatsthis_x = 0, cursor_whatsthis_y = 0 };
 static char const * const cursor_whatsthis_xpm[] = {
 "24 24 3 1",
@@ -368,4 +371,118 @@
 "                ",
 "                "};
+
+static bool qt_alloc_ps_with_bitmap(int w, int h, bool isMono,
+                                    HPS &hps, HBITMAP &hbm)
+{
+    hps = qt_alloc_mem_ps(32, 32);
+    if (hps == NULLHANDLE)
+        return false;
+
+    BITMAPINFOHEADER2 bmh;
+    bmh.cbFix = sizeof(BITMAPINFOHEADER2);
+    bmh.cx = w;
+    bmh.cy = h;
+    bmh.cPlanes = 1;
+    bmh.cBitCount = isMono ? 1 : 32;
+    hbm = GpiCreateBitmap(hps, &bmh, 0, 0, 0);
+    if (hbm == NULLHANDLE) {
+        qt_free_mem_ps(hps);
+        return false;
+    }
+
+    GpiSetBitmap(hps, hbm);
+    return true;
+}
+
+static void qt_free_ps_with_bitmap(HPS hps, HBITMAP hbm)
+{
+    GpiSetBitmap(hps, NULLHANDLE);
+    GpiDeleteBitmap(hbm);
+    qt_free_mem_ps(hps);
+}
+
+static HPOINTER combineTwoCursors(LONG idOver, LONG idUnder)
+{
+    HPOINTER hptr = NULLHANDLE;
+
+    POINTERINFO piOver, piUnder;
+    HPOINTER hOver = WinQuerySysPointer(HWND_DESKTOP, idOver, FALSE);
+    WinQueryPointerInfo(hOver, &piOver);
+    HPOINTER hUnder = WinQuerySysPointer(HWND_DESKTOP, idUnder, FALSE);
+    WinQueryPointerInfo(hUnder, &piUnder);
+    if (piOver.hbmColor) {
+        HPS hpsPtr, hpsTmp, hpsMask;
+        HBITMAP hbmPtr, hbmTmp, hbmMask;
+        qt_alloc_ps_with_bitmap(32, 32, false, hpsPtr, hbmPtr);
+        qt_alloc_ps_with_bitmap(32, 32, false, hpsTmp, hbmTmp);
+        qt_alloc_ps_with_bitmap(32, 64, true, hpsMask, hbmMask);
+        // copy the overlying pointer
+        POINTL ptls[] = { { 0, 0 }, { 31, 31 }, { 0, 0 }, { 32, 32 } };
+        GpiWCBitBlt(hpsTmp, piOver.hbmColor, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
+        // make its transparent pixels black
+        ptls[2].y += 32; ptls[3].y += 32;
+        GpiSetColor(hpsTmp, CLR_TRUE);
+        GpiSetBackColor(hpsTmp, CLR_FALSE);
+        GpiWCBitBlt(hpsTmp, piOver.hbmPointer, 4, ptls, 0x22, BBO_IGNORE);
+        // copy the underlying pointer
+        ptls[2].y -= 32; ptls[3].y -= 32;
+        GpiWCBitBlt(hpsPtr, piUnder.hbmColor, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
+        // make non-transparent pixels from the overlying pointer black
+        ptls[2].y += 32; ptls[3].y += 32;
+        GpiSetColor(hpsPtr, CLR_TRUE);
+        GpiSetBackColor(hpsPtr, CLR_FALSE);
+        GpiWCBitBlt(hpsPtr, piOver.hbmPointer, 4, ptls, ROP_SRCAND, BBO_IGNORE);
+        // put the overlying pointer there
+        ptls[2].y -= 32; ptls[3].y -= 32;
+        ptls[1].x ++; ptls[1].y ++;
+        GpiBitBlt(hpsPtr, hpsTmp, 4, ptls, ROP_SRCPAINT, BBO_IGNORE);
+        // copy both underlying pointer's masks
+        ptls[1].x --; ptls[1].y --;
+        ptls[1].y += 32; ptls[3].y += 32;
+        GpiWCBitBlt(hpsMask, piUnder.hbmPointer, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
+        // add overlying pointer's XOR mask
+        ptls[1].y -= 32; ptls[3].y -= 32;
+        GpiWCBitBlt(hpsMask, piOver.hbmPointer, 4, ptls, ROP_SRCPAINT, BBO_IGNORE);
+        // add overlying pointer's AND mask
+        ptls[0].y += 32; ptls[2].y += 32;
+        ptls[1].y += 32; ptls[3].y += 32;
+        GpiWCBitBlt(hpsMask, piOver.hbmPointer, 4, ptls, ROP_SRCAND, BBO_IGNORE);
+        // create the new pointer
+        GpiSetBitmap(hpsPtr, NULLHANDLE);
+        GpiSetBitmap(hpsMask, NULLHANDLE);
+        piOver.hbmColor = hbmPtr;
+        piOver.hbmPointer = hbmMask;
+        piOver.hbmMiniColor = NULLHANDLE;
+        piOver.hbmMiniPointer = NULLHANDLE;
+        hptr = WinCreatePointerIndirect(HWND_DESKTOP, &piOver);
+        qt_free_ps_with_bitmap(hpsMask,  hbmMask);
+        qt_free_ps_with_bitmap(hpsTmp,  hbmTmp);
+        qt_free_ps_with_bitmap(hpsPtr,  hbmPtr);
+    } else {
+        HPS hps;
+        HBITMAP hbm;
+        qt_alloc_ps_with_bitmap(32, 64, true, hps, hbm);
+        POINTL ptls[] = { { 0, 0 }, { 31, 63 }, { 0, 0 }, { 32, 64 } };
+        // make a copy of the underlying pointer
+        GpiWCBitBlt(hps, piUnder.hbmPointer, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
+        // combine AND masks
+        ptls[0].y += 32; ptls[2].y += 32;
+        GpiWCBitBlt(hps, piOver.hbmPointer, 4, ptls, ROP_SRCAND, BBO_IGNORE);
+        // apply the overlying AND mask to the underlying XOR mask
+        ptls[0].y -= 32; ptls[1].y -= 32;
+        GpiWCBitBlt(hps, piOver.hbmPointer, 4, ptls, ROP_SRCAND, BBO_IGNORE);
+        // apply the overlying XOR mask to the underlying XOR mask
+        ptls[2].y -= 32; ptls[3].y -= 32;
+        GpiWCBitBlt(hps, piOver.hbmPointer, 4, ptls, ROP_SRCINVERT, BBO_IGNORE);
+        // create the new pointer
+        GpiSetBitmap(hps, 0);
+        hptr = WinCreatePointer(HWND_DESKTOP, hbm, TRUE,
+                                piOver.xHotspot, piOver.yHotspot);
+        qt_free_ps_with_bitmap(hps, hbm);
+    }
+
+    Q_ASSERT(hptr);
+    return hptr;
+}
 
 void QCursorData::update()
@@ -456,6 +573,9 @@
         break;
     case Qt::BusyCursor:
-        id = SPTR_WAIT;
-        break;
+        // we create a busy cursor below as a combination of the standard
+        // arrow and wait cursors
+        hptr = combineTwoCursors(SPTR_ARROW, SPTR_WAIT);
+        isSysPtr = false;
+        return;
     case Qt::OpenHandCursor:
         xpm = cursor_openhand_xpm;
