VirtualBox

Ignore:
Timestamp:
Dec 12, 2022 6:36:50 PM (2 years ago)
Author:
vboxsync
Message:

DnD: Simplified / untangled reset handling:

  • Don't implicitly reset the DnD state with the GuestDnDSendCtx / GuestDnDRecvCtx classes; that can cause side effects.
  • Don't reset GuestDnDTargets state before sending data to the guest via GuestDnDTarget::sendData().
  • Don't reset the DnD state within GuestDnDState::setProgress() anymore. This needs to be done explicitly by the caller waiting for the progress.
  • Make sure to also clear the DnD state's callback map within GuestDnDState::reset().
  • Implemented a default guest callback, which gets invoked when no other (registered) guest callbacks are in place (anymore).
  • Return VERR_CANCELLED to VBoxTray / VBoxClient clients when there was a reset or the current operation was aborted.
  • Release (2) log what has been reset.
  • Implement reference counting for internal DnD messages within the host service; this should help wrt races between peeking for new client messages and actual retrieving those messages.
File:
1 edited

Legend:

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

    r97784 r97788  
    107107            return;
    108108
    109         int vrc = pThis->i_sendData(mpCtx, RT_INDEFINITE_WAIT /* msTimeout */);
    110         if (RT_FAILURE(vrc)) /* In case we missed some error handling within i_sendData(). */
    111         {
    112             if (vrc != VERR_CANCELLED)
    113                 LogRel(("DnD: Sending data to guest failed with %Rrc\n", vrc));
    114 
    115             /* Make sure to fire a cancel request to the guest side in case something went wrong. */
    116             pThis->sendCancel();
    117         }
     109        /* ignore rc */ pThis->i_sendData(mpCtx, RT_INDEFINITE_WAIT /* msTimeout */);
    118110    }
    119111
     
    720712        return setError(E_FAIL, tr("Current drop operation to guest still in progress"));
    721713
    722     /* Reset our internal state. */
    723     i_reset();
    724 
    725714    /* At the moment we only support one transfer at a time. */
    726715    if (GuestDnDInst()->getTargetCount())
     
    878867void GuestDnDTarget::i_reset(void)
    879868{
    880     LogFlowThisFunc(("\n"));
     869    LogRel2(("DnD: Target reset\n"));
    881870
    882871    mData.mSendCtx.reset();
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