VirtualBox

Changeset 97717 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 30, 2022 4:41:24 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154778
Message:

DnD/Main: Added some more (verbose) release logging for the drop target implementation and be a bit more informative wrt error reporting to the API client.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r96407 r97717  
    336336        Msg.appendUInt32(cbFormats);
    337337
     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
    338341        vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
    339342        if (RT_SUCCESS(vrc))
     
    413416        Msg.appendUInt32(cbFormats);
    414417
     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
    415421        vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
    416422        if (RT_SUCCESS(vrc))
     
    447453
    448454    HRESULT hrc = S_OK;
     455
     456    LogRel2(("DnD: Host left the VM window (screen %u)\n", uScreenId));
    449457
    450458    GuestDnDMsg Msg;
     
    536544        Msg.appendUInt32(cbFormats);
    537545
     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
    538549        int vrc = GuestDnDInst()->hostCall(Msg.getType(), Msg.getCount(), Msg.getParms());
    539550        if (RT_SUCCESS(vrc))
     
    543554            {
    544555                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? */
    548557                {
    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()));
    550575                }
    551                 else
    552                     /** @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());
    555576            }
    556577            else
     
    562583    else
    563584        hr = setError(hr, tr("Retrieving drop coordinates failed"));
    564 
    565     LogFlowFunc(("resFmt=%s, resAct=%RU32, vrc=%Rhrc\n", resFmt.c_str(), resAct, hr));
    566585
    567586    if (SUCCEEDED(hr))
     
    635654        mData.mSendCtx.Meta.strFmt = aFormat;
    636655        mData.mSendCtx.Meta.add(aData);
     656
     657        LogRel2(("DnD: Host sends data in format '%s'\n", aFormat.c_str()));
    637658
    638659        pTask = new GuestDnDSendDataTask(this, &mData.mSendCtx);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette