Changeset 97717 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 30, 2022 4:41:24 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154778
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r96407 r97717 336 336 Msg.appendUInt32(cbFormats); 337 337 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 338 341 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 339 342 if (RT_SUCCESS(vrc)) … … 413 416 Msg.appendUInt32(cbFormats); 414 417 418 LogRel2(("DnD: Host moves to %RU32,%RU32 in VM window (screen %u, default action is '%s')\n", 419 aX, aY, aScreenId, DnDActionToStr(dndActionDefault))); 420 415 421 vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 416 422 if (RT_SUCCESS(vrc)) … … 447 453 448 454 HRESULT hrc = S_OK; 455 456 LogRel2(("DnD: Host left the VM window (screen %u)\n", uScreenId)); 449 457 450 458 GuestDnDMsg Msg; … … 536 544 Msg.appendUInt32(cbFormats); 537 545 546 LogRel2(("DnD: Host drops at %RU32,%RU32 in VM window (screen %u, default action is '%s')\n", 547 aX, aY, aScreenId, DnDActionToStr(dndActionDefault))); 548 538 549 int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms()); 539 550 if (RT_SUCCESS(vrc)) … … 543 554 { 544 555 resAct = GuestDnD::toMainAction(pState->getActionDefault()); 545 546 GuestDnDMIMEList lstFormats = pState->formats(); 547 if (lstFormats.size() == 1) /* Exactly one format to use specified? */ 556 if (resAct != DnDAction_Ignore) /* Does the guest accept a drop at the current position? */ 548 557 { 549 resFmt = lstFormats.at(0); 558 GuestDnDMIMEList lstFormats = pState->formats(); 559 if (lstFormats.size() == 1) /* Exactly one format to use specified? */ 560 { 561 resFmt = lstFormats.at(0); 562 } 563 else 564 { 565 /** @todo r=bird: This isn't an IPRT error, is it? */ 566 if (lstFormats.size() == 0) 567 hr = setError(VBOX_E_IPRT_ERROR, tr("Guest accepted drop, but did not specify the format")); 568 else 569 hr = setError(VBOX_E_IPRT_ERROR, tr("Guest accepted drop, but returned more than one drop format (%zu formats)"), 570 lstFormats.size()); 571 } 572 573 LogRel2(("DnD: Guest accepted drop in format '%s' (action %#x, %zu format(s))\n", 574 resFmt.c_str(), resAct, lstFormats.size())); 550 575 } 551 else552 /** @todo r=bird: This isn't an IPRT error, is it? */553 hr = setError(VBOX_E_IPRT_ERROR, tr("Guest returned invalid drop formats (%zu formats)", "",554 lstFormats.size()), lstFormats.size());555 576 } 556 577 else … … 562 583 else 563 584 hr = setError(hr, tr("Retrieving drop coordinates failed")); 564 565 LogFlowFunc(("resFmt=%s, resAct=%RU32, vrc=%Rhrc\n", resFmt.c_str(), resAct, hr));566 585 567 586 if (SUCCEEDED(hr)) … … 635 654 mData.mSendCtx.Meta.strFmt = aFormat; 636 655 mData.mSendCtx.Meta.add(aData); 656 657 LogRel2(("DnD: Host sends data in format '%s'\n", aFormat.c_str())); 637 658 638 659 pTask = new GuestDnDSendDataTask(this, &mData.mSendCtx);
Note:
See TracChangeset
for help on using the changeset viewer.