Changeset 81060 in vbox for trunk/src/VBox/Additions/x11/VBoxClient
- Timestamp:
- Sep 27, 2019 2:32:13 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
r81052 r81060 181 181 * @returns VBox status code 182 182 */ 183 int SharedClipboardSvcImplConnect(void) 184 { 185 int rc = VINF_SUCCESS; 186 LogRelFlowFunc(("\n")); 183 static int vboxClipboardConnect(void) 184 { 185 LogFlowFuncEnter(); 187 186 188 187 /* Sanity */ 189 AssertReturn(g_ctx.client == 0, VERR_WRONG_ORDER); 188 AssertReturn(g_ctx.client == 0, VERR_WRONG_ORDER); 189 AssertReturn(g_ctx.pBackend == NULL, VERR_WRONG_ORDER); 190 191 int rc; 192 190 193 g_ctx.pBackend = ClipConstructX11(&g_ctx, false); 191 if (!g_ctx.pBackend) 194 if (g_ctx.pBackend) 195 { 196 rc = ClipStartX11(g_ctx.pBackend, false /* grab */); 197 if (RT_SUCCESS(rc)) 198 { 199 rc = VbglR3ClipboardConnect(&g_ctx.client); 200 if (RT_SUCCESS(rc)) 201 { 202 Assert(g_ctx.client); 203 } 204 else 205 VBClLogError("Error connecting to host, rc=%Rrc\n", rc); 206 } 207 } 208 else 192 209 rc = VERR_NO_MEMORY; 193 if (RT_SUCCESS(rc))194 rc = ClipStartX11(g_ctx.pBackend, false /* grab */);195 if (RT_SUCCESS(rc))196 {197 rc = VbglR3ClipboardConnect(&g_ctx.client);198 if (RT_FAILURE(rc))199 VBClLogError("Error connecting to host, rc=%Rrc\n", rc);200 else if (!g_ctx.client)201 {202 VBClLogError("Invalid client ID of 0\n");203 rc = VERR_NOT_SUPPORTED;204 }205 }206 210 207 211 if (rc != VINF_SUCCESS && g_ctx.pBackend) … … 300 304 301 305 /* Initialise the guest library. */ 302 int rc = SharedClipboardSvcImplConnect();303 /* Not RT_SUCCESS: VINF_PERMISSION_DENIED is host service not present. */304 if (rc == VINF_SUCCESS)306 int rc = vboxClipboardConnect(); 307 if (RT_SUCCESS(rc)) 308 { 305 309 rc = vboxClipboardMain(); 306 if (rc == VERR_NOT_SUPPORTED)307 rc = VINF_SUCCESS; /* Prevent automatic restart. */ 310 } 311 308 312 if (RT_FAILURE(rc)) 309 LogRelFunc(("guest clipboard service terminated abnormally: return code %Rrc\n", rc)); 313 VBClLogError("Service terminated abnormally with %Rrc\n", rc); 314 315 if (rc == VERR_HGCM_SERVICE_NOT_FOUND) 316 rc = VINF_SUCCESS; /* Prevent automatic restart by daemon script if host service not available. */ 317 310 318 return rc; 311 319 }
Note:
See TracChangeset
for help on using the changeset viewer.