VirtualBox

vbox的更動 97826 路徑 trunk/src/VBox/Additions/x11


忽略:
時間撮記:
2022-12-16 下午02:43:00 (2 年 以前)
作者:
vboxsync
訊息:

DnD/Additions/VBoxClient: Filter out the default X11-specific formats (required for Xdnd, 'TARGET' / 'MULTIPLE') when reporting formats to the host. Those formats are not part of the supported VirtualBox drag'n drop anyway. Related to r154902.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp

    r97768 r97826  
    314314    }
    315315
     316    /**
     317     * Returns a filtered X11 atom list.
     318     *
     319     * @returns Filtered list.
     320     * @param   formatList      Atom list to convert.
     321     * @param   filterList      Atom list to filter out.
     322     */
     323    inline VBoxDnDAtomList xAtomListFiltered(const VBoxDnDAtomList &formatList, const VBoxDnDAtomList &filterList)
     324    {
     325        VBoxDnDAtomList tempList = formatList;
     326        tempList.filter(filterList);
     327        return tempList;
     328    }
     329
    316330    RTCString xErrorToString(int xRc) const;
    317331    Window applicationWindowBelowCursor(Window parentWin) const;
     
    640654     *  Set to -1 if not set yet. */
    641655    int                         m_lastMouseY;
     656    /** List of default (Atom) formats required for X11 Xdnd handling.
     657     *  This list will be included by \a m_lstAtomFormats. */
     658    VBoxDnDAtomList             m_lstAtomFormatsX11;
    642659    /** List of (Atom) formats the current source/target window supports. */
    643660    VBoxDnDAtomList             m_lstAtomFormats;
     
    735752    , m_enmState(Uninitialized)
    736753{
     754    /* Append default targets we support.
     755     * Note: The order is sorted by preference; be careful when changing this. */
     756    m_lstAtomFormatsX11.append(xAtom(XA_TARGETS));
     757    m_lstAtomFormatsX11.append(xAtom(XA_MULTIPLE));
     758    /** @todo Support INC (incremental transfers). */
    737759}
    738760
     
    805827        m_lstAtomActions.clear();
    806828
    807         /* First, clear the formats list. */
     829        /* First, clear the formats list and apply the X11-specific default formats,
     830         * required for making Xdnd to work. */
    808831        m_lstAtomFormats.clear();
    809         /* Append default targets we support.
    810          * Note: The order is sorted by preference; be careful when changing this. */
    811         m_lstAtomFormats.append(xAtom(XA_TARGETS));
    812         m_lstAtomFormats.append(xAtom(XA_MULTIPLE));
    813         /** @todo Support INC (incremental transfers). */
     832        m_lstAtomFormats.append(m_lstAtomFormatsX11);
    814833
    815834        m_wndCur                 = 0;
     
    23352354    if (RT_SUCCESS(rc2))
    23362355    {
    2337         RTCString strFormatsCur = gX11->xAtomListToString(m_lstAtomFormats);
    2338         if (!strFormatsCur.isEmpty())
    2339         {
    2340             strFormats   = strFormatsCur;
     2356        /* Filter out the default X11-specific formats (required for Xdnd, 'TARGET' / 'MULTIPLE');
     2357         * those will not be supported by VirtualBox. */
     2358        VBoxDnDAtomList const lstAtomFormatsFiltered = gX11->xAtomListFiltered(m_lstAtomFormats, m_lstAtomFormatsX11);
     2359
     2360        /* Anything left to report to the host? */
     2361        if (lstAtomFormatsFiltered.size())
     2362        {
     2363            strFormats       = gX11->xAtomListToString(lstAtomFormatsFiltered);
    23412364            dndActionDefault = VBOX_DND_ACTION_COPY; /** @todo Handle default action! */
    23422365            dndActionList    = VBOX_DND_ACTION_COPY; /** @todo Ditto. */
     
    23452368
    23462369        RTCritSectLeave(&m_dataCS);
     2370    }
     2371
     2372    if (g_cVerbosity)
     2373    {
     2374        char *pszActions = DnDActionListToStrA(dndActionList);
     2375        AssertPtrReturn(pszActions, VERR_NO_MEMORY);
     2376        VBClLogVerbose(1, "Reporting formats '%s' (actions '%s' / %#x, default action is '%s' (%#x)\n",
     2377                       strFormats.c_str(), pszActions, dndActionList, DnDActionToStr(dndActionDefault), dndActionDefault);
     2378        RTStrFree(pszActions);
    23472379    }
    23482380
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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