Changeset 18586 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Mar 31, 2009 9:10:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp
r18585 r18586 54 54 RTSEMMUTEX clipboardMutex; 55 55 56 /** Pointer to the opaque X11 backend structure */ 57 VBOXCLIPBOARDCONTEXTX11 *pBackend; 56 58 /** Pointer to the client data structure */ 57 59 VBOXCLIPBOARDCLIENTDATA *pClient; … … 85 87 * data from X11. */ 86 88 LogFunc(("host requested guest clipboard data after guest had disconnected.\n")); 87 VBoxX11ClipboardAnnounceVBoxFormat( 0);89 VBoxX11ClipboardAnnounceVBoxFormat(pCtx->pBackend, 0); 88 90 pCtx->waiter = NONE; 89 91 return VERR_TIMEOUT; … … 162 164 { 163 165 int rc = VINF_SUCCESS; 166 VBOXCLIPBOARDCONTEXTX11 *pBackend = NULL; 167 164 168 LogRel(("Initializing host clipboard service\n")); 165 169 RTSemEventCreate(&g_ctxHost.waitForData); 166 170 RTSemMutexCreate(&g_ctxHost.clipboardMutex); 167 rc = VBoxX11ClipboardInitX11(&g_ctxHost );171 rc = VBoxX11ClipboardInitX11(&g_ctxHost, &pBackend); 168 172 if (RT_FAILURE(rc)) 169 173 { … … 172 176 LogRel(("Failed to start the host shared clipboard service.\n")); 173 177 } 178 else 179 g_ctxHost.pBackend = pBackend; 174 180 return rc; 175 181 } … … 197 203 * even if we are not waiting. */ 198 204 RTSemEventSignal(g_ctxHost.waitForData); 199 rc = VBoxX11ClipboardTermX11( );205 rc = VBoxX11ClipboardTermX11(g_ctxHost.pBackend); 200 206 if (RT_SUCCESS(rc)) 201 207 { … … 225 231 /** The pClient pointer is a dummy anyway, as we only support a single 226 232 * client at a time. */ 227 rc = VBoxX11ClipboardStartX11(X11 /* initial owner */); 233 rc = VBoxX11ClipboardStartX11(g_ctxHost.pBackend, 234 X11 /* initial owner */); 228 235 return rc; 229 236 } … … 246 253 vboxSvcClipboardReportMsg (g_ctxHost.pClient, 247 254 VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS, 0); 248 VBoxX11ClipboardRequestSyncX11( );255 VBoxX11ClipboardRequestSyncX11(g_ctxHost.pBackend); 249 256 250 257 return VINF_SUCCESS; … … 261 268 RTSemMutexRequest(g_ctxHost.clipboardMutex, RT_INDEFINITE_WAIT); 262 269 g_ctxHost.pClient = NULL; 263 VBoxX11ClipboardStopX11( );270 VBoxX11ClipboardStopX11(g_ctxHost.pBackend); 264 271 RTSemMutexRelease(g_ctxHost.clipboardMutex); 265 272 } … … 274 281 void vboxClipboardFormatAnnounce (VBOXCLIPBOARDCLIENTDATA *pClient, uint32_t u32Formats) 275 282 { 276 VBoxX11ClipboardAnnounceVBoxFormat ( u32Formats);283 VBoxX11ClipboardAnnounceVBoxFormat (g_ctxHost.pBackend, u32Formats); 277 284 } 278 285 … … 302 309 request.cb = cb; 303 310 request.pcbActual = pcbActual; 304 rc = VBoxX11ClipboardReadX11Data( u32Format, &request);311 rc = VBoxX11ClipboardReadX11Data(g_ctxHost.pBackend, u32Format, &request); 305 312 g_ctxHost.waiter = NONE; 306 313 return rc; … … 316 323 * @note Host glue code 317 324 */ 318 void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, void *pv, uint32_t cb, uint32_t u32Format) 325 void vboxClipboardWriteData (VBOXCLIPBOARDCLIENTDATA *pClient, 326 void *pv, uint32_t cb, uint32_t u32Format) 319 327 { 320 328 /* Assume that if this gets called at all then the X11 backend is running. */
Note:
See TracChangeset
for help on using the changeset viewer.