Changeset 97724 in vbox
- Timestamp:
- Dec 1, 2022 1:45:13 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r97720 r97724 318 318 Assert(m_lstFmtOffered.size()); 319 319 320 HRESULT hrc = S_OK;321 322 320 /* Adjust the coordinates in a multi-monitor setup. */ 323 int vrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);324 if ( RT_SUCCESS(vrc))321 HRESULT hrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 322 if (SUCCEEDED(hrc)) 325 323 { 326 324 GuestDnDMsg Msg; … … 336 334 Msg.appendUInt32(cbFormats); 337 335 338 LogRel2(("DnD: Host enters the VM window at %RU32,%RU32 (screen %u, default action is '%s')\n", 339 aX, aY, aScreenId, DnDActionToStr(dndActionDefault))); 340 341 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 336 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 342 337 if (RT_SUCCESS(vrc)) 343 338 { 344 if (RT_SUCCESS(m_pState->waitForGuestResponse())) 339 GuestDnDState *pState = GuestDnDInst()->getState(); 340 if (pState && RT_SUCCESS(vrc = pState->waitForGuestResponse())) 341 { 345 342 resAction = GuestDnD::toMainAction(m_pState->getActionDefault()); 346 } 347 } 348 349 if (RT_FAILURE(vrc)) 350 hrc = VBOX_E_DND_ERROR; 343 344 LogRel2(("DnD: Host enters the VM window at %RU32,%RU32 (screen %u, default action is '%s') -> guest reported back action '%s'\n", 345 aX, aY, aScreenId, DnDActionToStr(dndActionDefault), DnDActionToStr(resAction))); 346 } 347 else 348 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Waiting for response of enter event failed (%Rrc)"), vrc); 349 } 350 else 351 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Sending enter event to guest failed (%Rrc)"), vrc); 352 } 351 353 352 354 if (SUCCEEDED(hrc)) … … 399 401 const uint32_t cbFormats = (uint32_t)strFormats.length() + 1; /* Include terminating zero. */ 400 402 401 HRESULT hrc = S_OK; 402 403 int vrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 404 if (RT_SUCCESS(vrc)) 403 HRESULT hrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 404 if (SUCCEEDED(hrc)) 405 405 { 406 406 GuestDnDMsg Msg; … … 416 416 Msg.appendUInt32(cbFormats); 417 417 418 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());418 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 419 419 if (RT_SUCCESS(vrc)) 420 420 { 421 421 GuestDnDState *pState = GuestDnDInst()->getState(); 422 if (pState && RT_SUCCESS(pState->waitForGuestResponse())) 422 if (pState && RT_SUCCESS(vrc = pState->waitForGuestResponse())) 423 { 423 424 resAction = GuestDnD::toMainAction(pState->getActionDefault()); 424 425 425 LogRel2(("DnD: Host moved to %RU32,%RU32 in VM window (screen %u, default action is '%s') -> guest reported back action '%s'\n", 426 aX, aY, aScreenId, DnDActionToStr(dndActionDefault), DnDActionToStr(resAction))); 427 } 428 } 429 430 if (RT_FAILURE(vrc)) 431 hrc = VBOX_E_DND_ERROR; 426 LogRel2(("DnD: Host moved to %RU32,%RU32 in VM window (screen %u, default action is '%s') -> guest reported back action '%s'\n", 427 aX, aY, aScreenId, DnDActionToStr(dndActionDefault), DnDActionToStr(resAction))); 428 } 429 else 430 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Waiting for response of move event failed (%Rrc)"), vrc); 431 } 432 else 433 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Sending move event to guest failed (%Rrc)"), vrc); 434 } 435 else 436 hrc = setError(hrc, tr("Retrieving move coordinates failed")); 432 437 433 438 if (SUCCEEDED(hrc)) … … 465 470 { 466 471 GuestDnDState *pState = GuestDnDInst()->getState(); 467 if (pState) 468 pState->waitForGuestResponse(); 469 } 470 471 if (RT_FAILURE(vrc)) 472 hrc = VBOX_E_DND_ERROR; 472 if (pState && RT_SUCCESS(vrc = pState->waitForGuestResponse())) 473 { 474 /* Nothing to do here. */ 475 } 476 else 477 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Waiting for response of leave event failed (%Rrc)"), vrc); 478 } 479 else 480 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Sending leave event to guest failed (%Rrc)"), vrc); 473 481 474 482 LogFlowFunc(("hrc=%Rhrc\n", hrc)); … … 529 537 530 538 /* Adjust the coordinates in a multi-monitor setup. */ 531 HRESULT hr = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY);532 if (SUCCEEDED(hr ))539 HRESULT hrc = GuestDnDInst()->adjustScreenCoordinates(aScreenId, &aX, &aY); 540 if (SUCCEEDED(hrc)) 533 541 { 534 542 GuestDnDMsg Msg; … … 564 572 { 565 573 if (lstFormats.size() == 0) 566 hr = setError(VBOX_E_DND_ERROR, tr("Guest accepted drop, but did not specify the format"));574 hrc = setError(VBOX_E_DND_ERROR, tr("Guest accepted drop, but did not specify the format")); 567 575 else 568 hr = setError(VBOX_E_DND_ERROR, tr("Guest accepted drop, but returned more than one drop format (%zu formats)"),576 hrc = setError(VBOX_E_DND_ERROR, tr("Guest accepted drop, but returned more than one drop format (%zu formats)"), 569 577 lstFormats.size()); 570 578 } … … 575 583 } 576 584 else 577 hr = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Waiting for response of dropped event failed (%Rrc)"), vrc);585 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Waiting for response of dropped event failed (%Rrc)"), vrc); 578 586 } 579 587 else 580 hr = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Sending dropped event to guest failed (%Rrc)"), vrc);588 hrc = setErrorBoth(VBOX_E_DND_ERROR, vrc, tr("Sending dropped event to guest failed (%Rrc)"), vrc); 581 589 } 582 590 else 583 hr = setError(hr, tr("Retrieving drop coordinates failed"));584 585 if (SUCCEEDED(hr ))591 hrc = setError(hrc, tr("Retrieving drop coordinates failed")); 592 593 if (SUCCEEDED(hrc)) 586 594 { 587 595 aFormat = resFmt; … … 590 598 } 591 599 592 return hr ;600 return hrc; 593 601 #endif /* VBOX_WITH_DRAG_AND_DROP */ 594 602 }
Note:
See TracChangeset
for help on using the changeset viewer.