Changeset 55707 in vbox
- Timestamp:
- May 7, 2015 7:26:10 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r55571 r55707 193 193 } 194 194 195 RTCString xErrorToString(int x rc) const;195 RTCString xErrorToString(int xRc) const; 196 196 Window applicationWindowBelowCursor(Window parentWin) const; 197 197 … … 261 261 }; 262 262 263 RTCString xHelpers::xErrorToString(int x rc) const264 { 265 switch (x rc)266 { 267 case Success: return RTCStringFmt("%d (Success)", x rc);break;268 case BadRequest: return RTCStringFmt("%d (BadRequest)", x rc);break;269 case BadValue: return RTCStringFmt("%d (BadValue)", x rc);break;270 case BadWindow: return RTCStringFmt("%d (BadWindow)", x rc);break;271 case BadPixmap: return RTCStringFmt("%d (BadPixmap)", x rc);break;272 case BadAtom: return RTCStringFmt("%d (BadAtom)", x rc);break;273 case BadCursor: return RTCStringFmt("%d (BadCursor)", x rc);break;274 case BadFont: return RTCStringFmt("%d (BadFont)", x rc);break;275 case BadMatch: return RTCStringFmt("%d (BadMatch)", x rc);break;276 case BadDrawable: return RTCStringFmt("%d (BadDrawable)", x rc);break;277 case BadAccess: return RTCStringFmt("%d (BadAccess)", x rc);break;278 case BadAlloc: return RTCStringFmt("%d (BadAlloc)", x rc);break;279 case BadColor: return RTCStringFmt("%d (BadColor)", x rc);break;280 case BadGC: return RTCStringFmt("%d (BadGC)", x rc);break;281 case BadIDChoice: return RTCStringFmt("%d (BadIDChoice)", x rc);break;282 case BadName: return RTCStringFmt("%d (BadName)", x rc);break;283 case BadLength: return RTCStringFmt("%d (BadLength)", x rc);break;284 case BadImplementation: return RTCStringFmt("%d (BadImplementation)", x rc); break;285 } 286 return RTCStringFmt("%d (unknown)", x rc);263 RTCString xHelpers::xErrorToString(int xRc) const 264 { 265 switch (xRc) 266 { 267 case Success: return RTCStringFmt("%d (Success)", xRc); break; 268 case BadRequest: return RTCStringFmt("%d (BadRequest)", xRc); break; 269 case BadValue: return RTCStringFmt("%d (BadValue)", xRc); break; 270 case BadWindow: return RTCStringFmt("%d (BadWindow)", xRc); break; 271 case BadPixmap: return RTCStringFmt("%d (BadPixmap)", xRc); break; 272 case BadAtom: return RTCStringFmt("%d (BadAtom)", xRc); break; 273 case BadCursor: return RTCStringFmt("%d (BadCursor)", xRc); break; 274 case BadFont: return RTCStringFmt("%d (BadFont)", xRc); break; 275 case BadMatch: return RTCStringFmt("%d (BadMatch)", xRc); break; 276 case BadDrawable: return RTCStringFmt("%d (BadDrawable)", xRc); break; 277 case BadAccess: return RTCStringFmt("%d (BadAccess)", xRc); break; 278 case BadAlloc: return RTCStringFmt("%d (BadAlloc)", xRc); break; 279 case BadColor: return RTCStringFmt("%d (BadColor)", xRc); break; 280 case BadGC: return RTCStringFmt("%d (BadGC)", xRc); break; 281 case BadIDChoice: return RTCStringFmt("%d (BadIDChoice)", xRc); break; 282 case BadName: return RTCStringFmt("%d (BadName)", xRc); break; 283 case BadLength: return RTCStringFmt("%d (BadLength)", xRc); break; 284 case BadImplementation: return RTCStringFmt("%d (BadImplementation)", xRc); break; 285 } 286 return RTCStringFmt("%d (unknown)", xRc); 287 287 } 288 288 … … 342 342 343 343 /* For now only one DragInstance will exits when the app is running. In the 344 * future the support for having more than one D&Doperation supported at the344 * future the support for having more than one drag and drop operation supported at the 345 345 * time will be necessary. */ 346 346 class DragInstance … … 547 547 void DragInstance::reset(void) 548 548 { 549 LogFlowFuncEnter(); 550 549 551 /* Hide the proxy win. */ 550 552 proxyWinHide(); … … 565 567 m_curVer = -1; 566 568 m_state = Initialized; 569 m_mode = Unknown; 567 570 m_eventQueue.clear(); 568 571 } … … 841 844 s.xselection.property = e.xselectionrequest.property; 842 845 843 int x rc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s);844 if (RT_UNLIKELY(x rc == 0))846 int xRc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s); 847 if (RT_UNLIKELY(xRc == 0)) 845 848 LogFlowThisFunc(("Error sending SelectionNotify event to wnd=%#x\n", e.xselectionrequest.requestor)); 846 849 } … … 868 871 s.xselection.property = e.xselectionrequest.property; 869 872 870 int x rc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s);871 if (RT_UNLIKELY(x rc == 0))873 int xRc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s); 874 if (RT_UNLIKELY(xRc == 0)) 872 875 LogFlowThisFunc(("Error sending SelectionNotify event to wnd=%#x\n", e.xselectionrequest.requestor)); 873 876 } … … 901 904 s.xselection.target = None; /* default is refusing */ 902 905 s.xselection.property = None; /* default is refusing */ 903 int x rc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s);904 if (RT_UNLIKELY(x rc == 0))906 int xRc = XSendEvent(e.xselection.display, e.xselectionrequest.requestor, False, 0, &s); 907 if (RT_UNLIKELY(xRc == 0)) 905 908 LogFlowThisFunc(("Error sending SelectionNotify event to wnd=%#x\n", e.xselectionrequest.requestor)); 906 909 } … … 974 977 RTMSINTERVAL uTimeoutMS /* = 100 */) 975 978 { 976 LogFlowThisFunc(("iType=%d, uTimeoutMS=%RU32, cEventQueue=%zu\n", 977 iType, uTimeoutMS, m_eventQueue.size())); 979 LogFlowThisFunc(("iType=%d, uTimeoutMS=%RU32, cEventQueue=%zu\n", iType, uTimeoutMS, m_eventQueue.size())); 978 980 979 981 bool fFound = false; 980 982 const uint64_t uiStart = RTTimeMilliTS(); 983 981 984 do 982 985 { … … 1017 1020 while (RTTimeMilliTS() - uiStart < uTimeoutMS); 1018 1021 1019 LogFlowThisFunc(("Returning fFound=%RTbool, msRuntime=%RU64\n", 1020 fFound, RTTimeMilliTS() - uiStart)); 1022 LogFlowThisFunc(("Returning fFound=%RTbool, msRuntime=%RU64\n", fFound, RTTimeMilliTS() - uiStart)); 1021 1023 return fFound; 1022 1024 } … … 1080 1082 int DragInstance::hgEnter(const RTCList<RTCString> &formats, uint32_t uActions) 1081 1083 { 1084 if (m_mode != Unknown) 1085 return VERR_INVALID_STATE; 1086 1082 1087 reset(); 1083 1088 … … 1119 1124 1120 1125 int rc = VINF_SUCCESS; 1121 int x rc = Success;1126 int xRc = Success; 1122 1127 1123 1128 /* Move the mouse cursor within the guest. */ … … 1138 1143 /* Query the XdndAware property from the window. We are interested in 1139 1144 * the version and if it is XdndAware at all. */ 1140 x rc = XGetWindowProperty(m_pDisplay, wndCursor, xAtom(XA_XdndAware),1145 xRc = XGetWindowProperty(m_pDisplay, wndCursor, xAtom(XA_XdndAware), 1141 1146 0, 2, False, AnyPropertyType, 1142 1147 &atmp, &fmt, &cItems, &cbRemaining, &pcData); 1143 1148 1144 if (RT_UNLIKELY(x rc != Success))1145 logError("Error getting properties of cursor window=%#x: %s\n", wndCursor, gX11->xErrorToString(x rc).c_str());1149 if (RT_UNLIKELY(xRc != Success)) 1150 logError("Error getting properties of cursor window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str()); 1146 1151 else 1147 1152 { … … 1176 1181 m.data.l[0] = m_wndProxy; 1177 1182 1178 x rc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m));1179 if (RT_UNLIKELY(x rc == 0))1180 logError("DnD: Error sending XA_XdndLeave to old window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xrc).c_str());1183 xRc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1184 if (RT_UNLIKELY(xRc == 0)) 1185 logError("DnD: Error sending XA_XdndLeave event to old window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xRc).c_str()); 1181 1186 } 1182 1187 … … 1208 1213 m.data.l[4] = m_formats.value(2, None); 1209 1214 1210 x rc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m));1211 if (RT_UNLIKELY(x rc == 0))1212 logError("Error sending XA_XdndEnter to new window=%#x: %s\n", wndCursor, gX11->xErrorToString(xrc).c_str());1215 xRc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1216 if (RT_UNLIKELY(xRc == 0)) 1217 logError("Error sending XA_XdndEnter event to new window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str()); 1213 1218 } 1214 1219 … … 1235 1240 m.data.l[4] = pa; 1236 1241 1237 x rc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m));1238 if (RT_UNLIKELY(x rc == 0))1239 logError(("Error sending XA_XdndPosition to current window=%#x: %s\n", wndCursor, gX11->xErrorToString(xrc).c_str()));1242 xRc = XSendEvent(m_pDisplay, wndCursor, False, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1243 if (RT_UNLIKELY(xRc == 0)) 1244 logError(("Error sending XA_XdndPosition event to current window=%#x: %s\n", wndCursor, gX11->xErrorToString(xRc).c_str())); 1240 1245 } 1241 1246 … … 1261 1266 if ( m_mode != HG 1262 1267 || m_state != Dragging) 1268 { 1263 1269 return VERR_INVALID_STATE; 1270 } 1264 1271 1265 1272 int rc = VINF_SUCCESS; … … 1276 1283 m.data.l[2] = CurrentTime; 1277 1284 1278 int x rc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m));1279 if (RT_UNLIKELY(x rc == 0))1280 logError(("Error sending XA_XdndDrop to current window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xrc).c_str()));1285 int xRc = XSendEvent(m_pDisplay, m_wndCur, False, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1286 if (RT_UNLIKELY(xRc == 0)) 1287 logError(("Error sending XA_XdndDrop event to current window=%#x: %s\n", m_wndCur, gX11->xErrorToString(xRc).c_str())); 1281 1288 1282 1289 m_wndCur = None; … … 1289 1296 } 1290 1297 1291 int DragInstance::hgDataReceived(void *pvData, uint32_t c Data)1298 int DragInstance::hgDataReceived(void *pvData, uint32_t cbData) 1292 1299 { 1293 1300 if ( m_mode != HG 1294 1301 || m_state != Dropped) 1302 { 1295 1303 return VERR_INVALID_STATE; 1304 } 1296 1305 1297 1306 if (RT_UNLIKELY( pvData == NULL 1298 || cData == 0)) 1307 || cbData == 0)) 1308 { 1299 1309 return VERR_INVALID_PARAMETER; 1310 } 1300 1311 1301 1312 if (RT_UNLIKELY(m_state != Dropped)) … … 1303 1314 1304 1315 /* Make a copy of the data. The xserver will become the new owner. */ 1305 void *pvNewData = RTMemAlloc(c Data);1316 void *pvNewData = RTMemAlloc(cbData); 1306 1317 if (RT_UNLIKELY(!pvNewData)) 1307 1318 return VERR_NO_MEMORY; 1308 memcpy(pvNewData, pvData, cData); 1319 1320 memcpy(pvNewData, pvData, cbData); 1309 1321 1310 1322 /* … … 1334 1346 /* Fill up the property with the data. */ 1335 1347 XChangeProperty(s.xselection.display, s.xselection.requestor, s.xselection.property, s.xselection.target, 8, PropModeReplace, 1336 reinterpret_cast<const unsigned char*>(pvNewData), c Data);1337 int x rc = XSendEvent(s.xselection.display, s.xselection.requestor, True, 0, &s);1338 if (RT_UNLIKELY(x rc == 0))1348 reinterpret_cast<const unsigned char*>(pvNewData), cbData); 1349 int xRc = XSendEvent(s.xselection.display, s.xselection.requestor, True, 0, &s); 1350 if (RT_UNLIKELY(xRc == 0)) 1339 1351 { 1340 1352 logError(("Error sending SelectionNotify event to window=%#x: %s\n", 1341 s.xselection.requestor, gX11->xErrorToString(x rc).c_str()));1353 s.xselection.requestor, gX11->xErrorToString(xRc).c_str())); 1342 1354 } 1343 1355 … … 1348 1360 int DragInstance::ghIsDnDPending(void) 1349 1361 { 1362 LogFlowFuncEnter(); 1363 1364 if (m_mode == HG) 1365 return VERR_INVALID_STATE; 1366 1350 1367 int rc = VINF_SUCCESS; 1351 1368 Window wndSelection = XGetSelectionOwner(m_pDisplay, xAtom(XA_XdndSelection)); … … 1466 1483 if (RT_UNLIKELY(xRc == 0)) 1467 1484 { 1468 logError(("Error sending enter XA_XdndStatus to current window=%#x: %s\n",1485 logError(("Error sending enter XA_XdndStatus event to current window=%#x: %s\n", 1469 1486 m_wndCur, gX11->xErrorToString(xRc).c_str())); 1470 1487 } … … 1492 1509 if (RT_UNLIKELY(xRc == 0)) 1493 1510 { 1494 logError(("Error sending position XA_XdndStatus to current window=%#x: %s\n",1511 logError(("Error sending position XA_XdndStatus event to current window=%#x: %s\n", 1495 1512 m_wndCur, gX11->xErrorToString(xRc).c_str())); 1496 1513 } … … 1521 1538 int DragInstance::ghDropped(const RTCString &strFormat, uint32_t uAction) 1522 1539 { 1523 LogFlowThisFunc(("strFormat=%s, uAction=%RU32\n", 1524 strFormat.c_str(), uAction)); 1540 LogFlowThisFunc(("strFormat=%s, uAction=%RU32\n", strFormat.c_str(), uAction)); 1541 1542 if ( m_mode != GH 1543 || m_state != Dragging) 1544 { 1545 return VERR_INVALID_STATE; 1546 } 1525 1547 1526 1548 int rc = VINF_SUCCESS; … … 1548 1570 1 /* Button */, false /* Release button */); 1549 1571 1550 /* The fake button release event should lead to a XdndDrop event from the 1572 /** 1573 * The fake button release event above should lead to a XdndDrop event from the 1551 1574 * source. Because of showing our proxy window, other Xdnd events can 1552 1575 * occur before, e.g. a XdndPosition event. We are not interested 1553 * in those, so just try to get the right one. */ 1576 * in those, so just try to get the right one. 1577 */ 1554 1578 1555 1579 XClientMessageEvent evDnDDrop; 1556 bool fDrop = waitForX11ClientMsg(evDnDDrop, xAtom(XA_XdndDrop), 1557 5 * 1000 /* Timeout in ms */); 1580 bool fDrop = waitForX11ClientMsg(evDnDDrop, xAtom(XA_XdndDrop), 5 * 1000 /* Timeout in ms */); 1558 1581 if (fDrop) 1559 1582 { 1560 1583 /* Request to convert the selection in the specific format and 1561 1584 * place it to our proxy window as property. */ 1562 Window wndSource = evDnDDrop.data.l[0]; /* Source window which sent the message. */1585 Window wndSource = evDnDDrop.data.l[0]; /* Source window which has sent the message. */ 1563 1586 Assert(wndSource == m_wndCur); 1564 1587 Atom aFormat = gX11->stringToxAtom(strFormat.c_str()); 1565 1588 1566 XConvertSelection(m_pDisplay, xAtom(XA_XdndSelection), 1567 aFormat, xAtom(XA_XdndSelection), 1589 XConvertSelection(m_pDisplay, xAtom(XA_XdndSelection), aFormat, xAtom(XA_XdndSelection), 1568 1590 m_wndProxy, evDnDDrop.data.l[2]); 1569 1591 … … 1588 1610 unsigned long cItems, cbRemaining; 1589 1611 unsigned char *pcData = NULL; 1590 XGetWindowProperty(m_pDisplay, m_wndProxy, 1591 xAtom(XA_XdndSelection) /* Property */, 1592 0 /* Offset */, 1593 VBOX_MAX_XPROPERTIES /* Length of 32-bit multiples */, 1594 True /* Delete property? */, 1595 AnyPropertyType, /* Property type */ 1596 &aPropType, &iPropFormat, &cItems, &cbRemaining, &pcData); 1612 int xRc = XGetWindowProperty(m_pDisplay, m_wndProxy, 1613 xAtom(XA_XdndSelection) /* Property */, 1614 0 /* Offset */, 1615 VBOX_MAX_XPROPERTIES /* Length of 32-bit multiples */, 1616 True /* Delete property? */, 1617 AnyPropertyType, /* Property type */ 1618 &aPropType, &iPropFormat, &cItems, &cbRemaining, &pcData); 1619 if (RT_UNLIKELY(xRc == 0)) 1620 LogFlowThisFunc(("Error getting XA_XdndSelection property of proxy window=%#x: %s\n", 1621 m_wndProxy, gX11->xErrorToString(xRc).c_str())); 1597 1622 1598 1623 LogFlowThisFunc(("strType=%s, iPropFormat=%d, cItems=%RU32, cbRemaining=%RU32\n", … … 1648 1673 m.data.l[2] = RT_SUCCESS(rc) ? toX11Action(uAction) : None; /* Action used on success */ 1649 1674 1650 int xrc = XSendEvent(m_pDisplay, wndSource, True, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1651 if (RT_UNLIKELY(xrc == 0)) 1652 LogFlowThisFunc(("Error sending xEvent\n")); 1675 xRc = XSendEvent(m_pDisplay, wndSource, True, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1676 if (RT_UNLIKELY(xRc == 0)) 1677 LogFlowThisFunc(("Error sending XA_XdndFinished event to proxy window=%#x: %s\n", 1678 m_wndProxy, gX11->xErrorToString(xRc).c_str())); 1653 1679 } 1654 1680 else … … 1665 1691 else 1666 1692 { 1667 AssertMsgFailed(("Not supported data type (%s)\n", 1668 gX11->xAtomToString(aPropType).c_str())); 1669 rc = VERR_INVALID_PARAMETER; 1693 LogFlowFunc(("Not supported data type: %s\n", gX11->xAtomToString(aPropType).c_str())); 1694 rc = VERR_NOT_SUPPORTED; 1670 1695 } 1671 1696 … … 1688 1713 m.data.l[1] = 0; /* Don't accept the drop to not make the guest stuck. */ 1689 1714 1690 int xrc = XSendEvent(m_pDisplay, wndSource, False, NoEventMask, reinterpret_cast<XEvent*>(&m));1691 if (RT_UNLIKELY(x rc == 0))1715 xRc = XSendEvent(m_pDisplay, wndSource, False, NoEventMask, reinterpret_cast<XEvent*>(&m)); 1716 if (RT_UNLIKELY(xRc == 0)) 1692 1717 { 1693 logError(("Error sending XA_XdndFinished to proxy window=%#x: %s\n",1694 m_wndProxy, gX11->xErrorToString(x rc).c_str()));1718 logError(("Error sending XA_XdndFinished event to proxy window=%#x: %s\n", 1719 m_wndProxy, gX11->xErrorToString(xRc).c_str())); 1695 1720 } 1696 1721 } … … 1735 1760 /* Move the guest pointer to the DnD position, so we can find the window 1736 1761 * below that position. */ 1737 XWarpPointer(m_pDisplay, None, m_wndRoot, 0, 0, 0, 0, iPosX, iPosY);1762 XWarpPointer(m_pDisplay, None, m_wndRoot, 0, 0, 0, 0, RT_MAX(0, iPosX), RT_MAX(0, iPosY)); 1738 1763 return VINF_SUCCESS; 1739 1764 } … … 1780 1805 LogFlowThisFunc(("XText extension available\n")); 1781 1806 1782 int x rc = XTestFakeButtonEvent(m_pDisplay, 1, fPress ? True : False, CurrentTime);1783 if (RT_UNLIKELY(x rc == 0))1784 LogFlowThisFunc(("Error sending XTestFakeButtonEvent event \n"));1807 int xRc = XTestFakeButtonEvent(m_pDisplay, 1, fPress ? True : False, CurrentTime); 1808 if (RT_UNLIKELY(xRc == 0)) 1809 LogFlowThisFunc(("Error sending XTestFakeButtonEvent event: %s\n", gX11->xErrorToString(xRc).c_str())); 1785 1810 XFlush(m_pDisplay); 1786 1811 } … … 1812 1837 //XTranslateCoordinates(m_pDisplay, eBtn.root, eBtn.window, eBtn.x_root, eBtn.y_root, &eBtn.x, &eBtn.y, &eBtn.subwindow); 1813 1838 #if 0 1814 int x rc = XSendEvent(m_pDisplay, eBtn.window, True /* fPropagate */,1839 int xRc = XSendEvent(m_pDisplay, eBtn.window, True /* fPropagate */, 1815 1840 fPress 1816 1841 ? ButtonPressMask : ButtonReleaseMask, 1817 1842 reinterpret_cast<XEvent*>(&eBtn)); 1818 1843 #else 1819 int xrc = XSendEvent(m_pDisplay, eBtn.window, False /* fPropagate */, 1820 0 /* Mask */, 1821 reinterpret_cast<XEvent*>(&eBtn)); 1844 int xRc = XSendEvent(m_pDisplay, eBtn.window, False /* fPropagate */, 1845 0 /* Mask */, reinterpret_cast<XEvent*>(&eBtn)); 1822 1846 #endif 1823 if (RT_UNLIKELY(x rc == 0))1824 LogFlowThisFunc(("Error sending X SendEvent\n"));1847 if (RT_UNLIKELY(xRc == 0)) 1848 LogFlowThisFunc(("Error sending XButtonEvent event to window=%#x: %s\n", wndDest, gX11->xErrorToString(xRc).c_str())); 1825 1849 1826 1850 #ifdef DEBUG … … 1852 1876 1853 1877 // XTestGrabControl(m_pDisplay, False); 1878 1879 /* Get the mouse pointer position and determine if we're on the same screen as the root window 1880 * and returns the current child window beneath our mouse pointer, if any. */ 1854 1881 Bool fInRootWnd = XQueryPointer(m_pDisplay, m_wndRoot, &wndRoot, &wndChild, 1855 1882 &iRootX, &iRootY, 1856 1883 &iChildX, &iChildY, &iMask); 1857 #ifdef DEBUG_andy 1884 1858 1885 LogFlowThisFunc(("fInRootWnd=%RTbool, wndRoot=0x%x, wndChild=0x%x, iRootX=%d, iRootY=%d\n", 1859 1886 RT_BOOL(fInRootWnd), wndRoot, wndChild, iRootX, iRootY)); 1860 #endif1861 1887 1862 1888 if (piRootX) … … 1867 1893 XSynchronize(m_pDisplay, True /* Enable sync */); 1868 1894 1895 /* Bring our proxy window into foreground. */ 1869 1896 XMapWindow(m_pDisplay, m_wndProxy); 1870 1897 XRaiseWindow(m_pDisplay, m_wndProxy); 1871 XMoveResizeWindow(m_pDisplay, m_wndProxy, iRootX, iRootY, 100, 100); 1898 1899 /* Resize our proxy window so that it gets displayed right in center of our mouse cursor. */ 1900 const int iProxyX = RT_MAX(0, iRootX - 50); 1901 const int iProxyY = RT_MAX(0, iRootY - 50); 1902 LogFlowThisFunc(("iProxyX=%d, iProxyY=%d\n", iProxyX, iProxyY)); 1903 XMoveResizeWindow(m_pDisplay, m_wndProxy, iProxyX, iProxyY, 100, 100); 1872 1904 1873 1905 if (fMouseMove) … … 2142 2174 case DragAndDropSvc::HOST_DND_HG_EVT_MOVE: 2143 2175 { 2144 m_pCurDnD->hgMove(e.hgcm.u.a.uXpos, e.hgcm.u.a.uYpos, 2145 e.hgcm.u.a.uDefAction); 2176 rc = m_pCurDnD->hgMove(e.hgcm.u.a.uXpos, e.hgcm.u.a.uYpos, e.hgcm.u.a.uDefAction); 2146 2177 break; 2147 2178 } … … 2153 2184 case DragAndDropSvc::HOST_DND_HG_EVT_DROPPED: 2154 2185 { 2155 m_pCurDnD->hgDrop();2186 rc = m_pCurDnD->hgDrop(); 2156 2187 break; 2157 2188 } 2158 2189 case DragAndDropSvc::HOST_DND_HG_SND_DATA: 2159 2190 { 2160 m_pCurDnD->hgDataReceived(e.hgcm.u.b.pvData, e.hgcm.u.b.cbData);2191 rc = m_pCurDnD->hgDataReceived(e.hgcm.u.b.pvData, e.hgcm.u.b.cbData); 2161 2192 break; 2162 2193 } … … 2164 2195 { 2165 2196 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 2166 m_pCurDnD->ghIsDnDPending();2197 rc = m_pCurDnD->ghIsDnDPending(); 2167 2198 #endif 2168 2199 break; … … 2171 2202 { 2172 2203 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 2173 m_pCurDnD->ghDropped(e.hgcm.pszFormats, 2174 e.hgcm.u.a.uDefAction); 2204 rc = m_pCurDnD->ghDropped(e.hgcm.pszFormats, e.hgcm.u.a.uDefAction); 2175 2205 #endif 2176 2206 break; … … 2178 2208 2179 2209 default: 2180 LogFlowThisFunc(("Unknown message: %RU32\n", e.hgcm.uType)); 2210 LogFlowThisFunc(("Unsupported message: %RU32\n", e.hgcm.uType)); 2211 rc = VERR_NOT_SUPPORTED; 2181 2212 break; 2182 2213 } 2214 2215 LogFlowFunc(("Returning %Rrc\n", rc)); 2183 2216 2184 2217 /* Some messages require cleanup. */
Note:
See TracChangeset
for help on using the changeset viewer.