Changeset 46377 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 4, 2013 11:59:37 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86196
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r42320 r46377 81 81 # define DO(s) RTPrintf s 82 82 #else 83 # define DO(s) do {} while (0)83 # define DO(s) do {} while (0) 84 84 //# define DO(s) Log s 85 85 #endif … … 595 595 XChangeProperty(m_pDisplay, m_proxyWin, xAtom(XA_XdndAware), XA_ATOM, 32, PropModeReplace, 596 596 reinterpret_cast<unsigned char*>(&ver), 1); 597 } while (0);597 } while (0); 598 598 599 599 m_state = Initialized; … … 1137 1137 } 1138 1138 } 1139 } while (tries--);1139 } while (tries--); 1140 1140 if (clme) 1141 1141 { … … 1503 1503 } 1504 1504 1505 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 1506 1505 1507 bool DragAndDropService::waitForXMsg(XEvent &ecm, int type, uint32_t uiMaxMS /* = 100 */) 1506 1508 { … … 1530 1532 // return false; 1531 1533 } 1532 while (RTTimeProgramMilliTS() - uiStart < uiMaxMS);1534 while (RTTimeProgramMilliTS() - uiStart < uiMaxMS); 1533 1535 1534 1536 return false; 1535 1537 } 1538 1539 #endif 1536 1540 1537 1541 void DragAndDropService::clearEventQueue() … … 1574 1578 RT_ZERO(e); 1575 1579 if (m_eventQueue.isEmpty()) 1576 rc = RTSemEventWait(m_hEventSem, 50);1580 rc = RTSemEventWait(m_hEventSem, RT_INDEFINITE_WAIT); 1577 1581 if (!m_eventQueue.isEmpty()) 1578 1582 { … … 1665 1669 } 1666 1670 } 1667 } while (!ASMAtomicReadBool(&m_fSrvStopping));1668 } while (0);1671 } while (!ASMAtomicReadBool(&m_fSrvStopping)); 1672 } while (0); 1669 1673 1670 1674 LogRelFlowFunc(("returning %Rrc\n", rc)); … … 1699 1703 0, RTTHREADTYPE_MSG_PUMP, RTTHREADFLAGS_WAITABLE, 1700 1704 "X11-NOTIFY"); 1701 } while (0);1705 } while (0); 1702 1706 1703 1707 /* Cleanup on failure */ … … 1712 1716 /* Mark that we are stopping. */ 1713 1717 ASMAtomicWriteBool(&m_fSrvStopping, true); 1714 1718 RTSemEventSignal(m_hEventSem); 1719 1715 1720 if (m_pDisplay) 1716 1721 { … … 1727 1732 DO(("DnD_TERM: error sending xevent\n")); 1728 1733 } 1734 1735 /* We cannot signal the m_hHGCMThread as it is most likely waiting in vbglR3DoIOCtl() */ 1729 1736 /* Wait for our event threads to stop. */ 1730 // if (m_hX11Thread) 1731 // RTThreadWait(m_hX11Thread, RT_INDEFINITE_WAIT, 0); 1732 // if (m_hHGCMThread) 1733 // RTThreadWait(m_hHGCMThread, RT_INDEFINITE_WAIT, 0); 1737 if (m_hX11Thread) 1738 RTThreadWait(m_hX11Thread, RT_INDEFINITE_WAIT, NULL); 1734 1739 /* Cleanup */ 1735 1740 /* todo: This doesn't work. The semaphore was interrupted by the user … … 1749 1754 { 1750 1755 AssertPtrReturn(pvUser, VERR_INVALID_PARAMETER); 1751 DragAndDropService *p Srv= static_cast<DragAndDropService*>(pvUser);1756 DragAndDropService *pThis = static_cast<DragAndDropService*>(pvUser); 1752 1757 DnDEvent e; 1753 1758 do … … 1759 1764 if (RT_SUCCESS(rc)) 1760 1765 { 1761 p Srv->m_eventQueue.append(e);1762 rc = RTSemEventSignal(p Srv->m_hEventSem);1766 pThis->m_eventQueue.append(e); 1767 rc = RTSemEventSignal(pThis->m_hEventSem); 1763 1768 if (RT_FAILURE(rc)) 1764 1769 return rc; 1765 1770 } 1766 } while (!ASMAtomicReadBool(&pSrv->m_fSrvStopping));1771 } while (!ASMAtomicReadBool(&pThis->m_fSrvStopping)); 1767 1772 1768 1773 return VINF_SUCCESS; … … 1773 1778 { 1774 1779 AssertPtrReturn(pvUser, VERR_INVALID_PARAMETER); 1775 DragAndDropService *p Srv= static_cast<DragAndDropService*>(pvUser);1780 DragAndDropService *pThis = static_cast<DragAndDropService*>(pvUser); 1776 1781 DnDEvent e; 1777 1782 do … … 1782 1787 * events and if there are not any new one, sleep for a certain amount 1783 1788 * of time. */ 1784 if (XEventsQueued(p Srv->m_pDisplay, QueuedAfterFlush) > 0)1789 if (XEventsQueued(pThis->m_pDisplay, QueuedAfterFlush) > 0) 1785 1790 { 1786 1791 RT_ZERO(e); 1787 1792 e.type = DnDEvent::X11_Type; 1788 XNextEvent(pSrv->m_pDisplay, &e.x11); 1793 XNextEvent(pThis->m_pDisplay, &e.x11); 1794 #if 0 1795 /* We never detect the stop event here for some reason */ 1789 1796 /* Check for a stop message. */ 1790 // if ( e.x11.type == ClientMessage 1791 // && e.x11.xclient.message_type == xAtom(XA_dndstop)) 1792 // { 1793 // break; 1794 // } 1795 // if (isDnDRespondEvent(pSrv->m_pDisplay, &e.x11, 0)) 1797 if ( e.x11.type == ClientMessage 1798 && e.x11.xclient.message_type == xAtom(XA_dndstop)) 1799 break; 1800 #endif 1801 // if (isDnDRespondEvent(pThis->m_pDisplay, &e.x11, 0)) 1796 1802 { 1797 1803 /* Appending makes a copy of the event structure. */ 1798 p Srv->m_eventQueue.append(e);1799 int rc = RTSemEventSignal(p Srv->m_hEventSem);1804 pThis->m_eventQueue.append(e); 1805 int rc = RTSemEventSignal(pThis->m_hEventSem); 1800 1806 if (RT_FAILURE(rc)) 1801 1807 return rc; … … 1804 1810 else 1805 1811 RTThreadSleep(25); 1806 } while (!ASMAtomicReadBool(&pSrv->m_fSrvStopping));1812 } while (!ASMAtomicReadBool(&pThis->m_fSrvStopping)); 1807 1813 1808 1814 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.