未验证 提交 07c5afba 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #76285 from microsoft/isidorn/linuxRemoteDnD

linux remote: disable dnd to desktop
......@@ -20,7 +20,7 @@ import { DataTransfers } from 'vs/base/browser/dnd';
import { DragMouseEvent } from 'vs/base/browser/mouseEvent';
import { normalizeDriveLetter } from 'vs/base/common/labels';
import { MIME_BINARY } from 'vs/base/common/mime';
import { isWindows } from 'vs/base/common/platform';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorIdentifier, GroupIdentifier } from 'vs/workbench/common/editor';
......@@ -31,6 +31,7 @@ import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsSe
import { IRecentFile } from 'vs/platform/history/common/history';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
import { withNullAsUndefined } from 'vs/base/common/types';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
export interface IDraggedResource {
resource: URI;
......@@ -327,8 +328,12 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources:
const lineDelimiter = isWindows ? '\r\n' : '\n';
event.dataTransfer.setData(DataTransfers.TEXT, sources.map(source => source.resource.scheme === Schemas.file ? normalize(normalizeDriveLetter(source.resource.fsPath)) : source.resource.toString()).join(lineDelimiter));
// Download URL: enables support to drag a tab as file to desktop (only single file supported)
event.dataTransfer.setData(DataTransfers.DOWNLOAD_URL, [MIME_BINARY, basename(firstSource.resource), firstSource.resource.toString()].join(':'));
const envService = accessor.get(IWorkbenchEnvironmentService);
if (!(isLinux && envService.configuration.remoteAuthority)) {
// Download URL: enables support to drag a tab as file to desktop (only single file supported)
// Not supported on linux remote due to chrome limitation https://github.com/microsoft/vscode-remote-release/issues/849
event.dataTransfer.setData(DataTransfers.DOWNLOAD_URL, [MIME_BINARY, basename(firstSource.resource), firstSource.resource.toString()].join(':'));
}
// Resource URLs: allows to drop multiple resources to a target in VS Code (not directories)
const files = sources.filter(s => !s.isDirectory);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册