Changeset 50478 in vbox for trunk/src/VBox/Additions/x11/VBoxClient
- Timestamp:
- Feb 17, 2014 2:09:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
r50265 r50478 427 427 virtual void cleanup(void) 428 428 { 429 /* Cleanup */430 x11DragAndDropTerm();429 /* Nothing to do, everything should be cleaned up automatically when the 430 * user process/X11 client exits. */ 431 431 }; 432 432 433 433 private: 434 434 int x11DragAndDropInit(void); 435 int x11DragAndDropTerm(void);436 435 static int hgcmEventThread(RTTHREAD hThread, void *pvUser); 437 436 static int x11EventThread(RTTHREAD hThread, void *pvUser); … … 1765 1764 } while (0); 1766 1765 1767 /* Cleanup on failure */ 1768 if (RT_FAILURE(rc)) 1769 x11DragAndDropTerm(); 1766 /* No clean-up code for now, as we have no good way of testing it and things 1767 * should get cleaned up when the user process/X11 client exits. */ 1770 1768 1771 1769 return rc; 1772 }1773 1774 int DragAndDropService::x11DragAndDropTerm(void)1775 {1776 /* Mark that we are stopping. */1777 ASMAtomicWriteBool(&m_fSrvStopping, true);1778 RTSemEventSignal(m_hEventSem);1779 1780 if (m_pDisplay)1781 {1782 /* Send a x11 client messages to the x11 event loop. */1783 XClientMessageEvent m;1784 RT_ZERO(m);1785 m.type = ClientMessage;1786 m.display = m_pDisplay;1787 m.window = None;1788 m.message_type = xAtom(XA_dndstop);1789 m.format = 32;1790 int xrc = XSendEvent(m_pDisplay, None, True, NoEventMask, reinterpret_cast<XEvent*>(&m));1791 if (RT_UNLIKELY(xrc == 0))1792 LogFlowThisFunc(("Error sending xevent\n"));1793 }1794 1795 /* We cannot signal the m_hHGCMThread as it is most likely waiting in vbglR3DoIOCtl() */1796 /** @todo r=michael Don't we have a mechanism for cancelling HGCM calls1797 * though? */1798 /* Wait for our event threads to stop. */1799 /** @todo r=michael This routine is generally called on the X11 thread,1800 * protected by a mutex, so the following thread wait1801 * makes us hang forever. */1802 if (m_hX11Thread)1803 RTThreadWait(m_hX11Thread, RT_INDEFINITE_WAIT, NULL);1804 /* Cleanup */1805 /* todo: This doesn't work. The semaphore was interrupted by the user1806 * signal. It is not possible to destroy a semaphore while it is in interrupted state.1807 * According to Frank, the cleanup stuff done here is done _wrong_. We just1808 * should signal the main loop to stop and do the cleanup there. Needs1809 * adoption in all VBoxClient::Service's. */1810 // if (m_hEventSem)1811 // RTSemEventDestroy(m_hEventSem);1812 if (m_pDisplay)1813 XCloseDisplay(m_pDisplay);1814 return VINF_SUCCESS;1815 1770 } 1816 1771 … … 1886 1841 e.type = DnDEvent::X11_Type; 1887 1842 XNextEvent(pThis->m_pDisplay, &e.x11); 1888 #if 01889 /* We never detect the stop event here for some reason */1890 /* Check for a stop message. */1891 if ( e.x11.type == ClientMessage1892 && e.x11.xclient.message_type == xAtom(XA_dndstop))1893 break;1894 #endif1895 // if (isDnDRespondEvent(pThis->m_pDisplay, &e.x11, 0))1896 1843 { 1897 1844 /* Appending makes a copy of the event structure. */
Note:
See TracChangeset
for help on using the changeset viewer.