Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7d1cd1ff
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7d1cd1ff
编写于
11月 20, 2020
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #99313
上级
690d0e33
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
93 addition
and
9 deletion
+93
-9
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+6
-0
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+0
-3
src/vs/platform/display/common/displayMainService.ts
src/vs/platform/display/common/displayMainService.ts
+11
-0
src/vs/platform/display/electron-main/displayMainService.ts
src/vs/platform/display/electron-main/displayMainService.ts
+47
-0
src/vs/workbench/contrib/codeEditor/electron-sandbox/codeEditor.contribution.ts
...ib/codeEditor/electron-sandbox/codeEditor.contribution.ts
+1
-0
src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
...odeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
+28
-0
src/vs/workbench/electron-sandbox/window.ts
src/vs/workbench/electron-sandbox/window.ts
+0
-6
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
7d1cd1ff
...
...
@@ -85,6 +85,7 @@ import { ActiveWindowManager } from 'vs/platform/windows/common/windowTracker';
import
{
IKeyboardLayoutMainService
,
KeyboardLayoutMainService
}
from
'
vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService
'
;
import
{
toErrorMessage
}
from
'
vs/base/common/errorMessage
'
;
import
{
NativeParsedArgs
}
from
'
vs/platform/environment/common/argv
'
;
import
{
DisplayMainService
,
IDisplayMainService
}
from
'
vs/platform/display/electron-main/displayMainService
'
;
export
class
CodeApplication
extends
Disposable
{
private
windowsMainService
:
IWindowsMainService
|
undefined
;
...
...
@@ -464,6 +465,7 @@ export class CodeApplication extends Disposable {
services
.
set
(
IIssueMainService
,
new
SyncDescriptor
(
IssueMainService
,
[
machineId
,
this
.
userEnv
]));
services
.
set
(
IEncryptionMainService
,
new
SyncDescriptor
(
EncryptionMainService
,
[
machineId
]));
services
.
set
(
IKeyboardLayoutMainService
,
new
SyncDescriptor
(
KeyboardLayoutMainService
));
services
.
set
(
IDisplayMainService
,
new
SyncDescriptor
(
DisplayMainService
));
services
.
set
(
INativeHostMainService
,
new
SyncDescriptor
(
NativeHostMainService
));
services
.
set
(
IWebviewManagerService
,
new
SyncDescriptor
(
WebviewMainService
));
services
.
set
(
IWorkspacesService
,
new
SyncDescriptor
(
WorkspacesService
));
...
...
@@ -558,6 +560,10 @@ export class CodeApplication extends Disposable {
const
keyboardLayoutChannel
=
createChannelReceiver
(
keyboardLayoutMainService
);
electronIpcServer
.
registerChannel
(
'
keyboardLayout
'
,
keyboardLayoutChannel
);
const
displayMainService
=
accessor
.
get
(
IDisplayMainService
);
const
displayChannel
=
createChannelReceiver
(
displayMainService
);
electronIpcServer
.
registerChannel
(
'
display
'
,
displayChannel
);
const
nativeHostMainService
=
this
.
nativeHostMainService
=
accessor
.
get
(
INativeHostMainService
);
const
nativeHostChannel
=
createChannelReceiver
(
this
.
nativeHostMainService
);
electronIpcServer
.
registerChannel
(
'
nativeHost
'
,
nativeHostChannel
);
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
7d1cd1ff
...
...
@@ -468,9 +468,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return
;
// disposed
}
// Notify renderers about displays changed
this
.
sendWhenReady
(
'
vscode:displayChanged
'
);
// Simple fullscreen doesn't resize automatically when the resolution changes so as a workaround
// we need to detect when display metrics change or displays are added/removed and toggle the
// fullscreen manually.
...
...
src/vs/platform/display/common/displayMainService.ts
0 → 100644
浏览文件 @
7d1cd1ff
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Event
}
from
'
vs/base/common/event
'
;
export
interface
IDisplayMainService
{
readonly
_serviceBrand
:
undefined
;
readonly
onDidDisplayChanged
:
Event
<
void
>
;
}
src/vs/platform/display/electron-main/displayMainService.ts
0 → 100644
浏览文件 @
7d1cd1ff
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IDisplayMainService
as
ICommonDisplayMainService
}
from
'
vs/platform/display/common/displayMainService
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Disposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
app
,
Display
,
screen
}
from
'
electron
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
export
const
IDisplayMainService
=
createDecorator
<
IDisplayMainService
>
(
'
displayMainService
'
);
export
interface
IDisplayMainService
extends
ICommonDisplayMainService
{
}
export
class
DisplayMainService
extends
Disposable
implements
ICommonDisplayMainService
{
declare
readonly
_serviceBrand
:
undefined
;
private
readonly
_onDidDisplayChanged
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidDisplayChanged
=
this
.
_onDidDisplayChanged
.
event
;
constructor
()
{
super
();
const
displayChangedScheduler
=
this
.
_register
(
new
RunOnceScheduler
(()
=>
{
this
.
_onDidDisplayChanged
.
fire
();
},
100
));
app
.
whenReady
().
then
(()
=>
{
const
displayChangedListener
=
(
event
:
Event
,
display
:
Display
,
changedMetrics
?:
string
[])
=>
{
displayChangedScheduler
.
schedule
();
};
screen
.
on
(
'
display-metrics-changed
'
,
displayChangedListener
);
this
.
_register
(
toDisposable
(()
=>
screen
.
removeListener
(
'
display-metrics-changed
'
,
displayChangedListener
)));
screen
.
on
(
'
display-added
'
,
displayChangedListener
);
this
.
_register
(
toDisposable
(()
=>
screen
.
removeListener
(
'
display-added
'
,
displayChangedListener
)));
screen
.
on
(
'
display-removed
'
,
displayChangedListener
);
this
.
_register
(
toDisposable
(()
=>
screen
.
removeListener
(
'
display-removed
'
,
displayChangedListener
)));
});
}
}
src/vs/workbench/contrib/codeEditor/electron-sandbox/codeEditor.contribution.ts
浏览文件 @
7d1cd1ff
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
'
./displayChangeRemeasureFonts
'
;
import
'
./inputClipboardActions
'
;
import
'
./selectionClipboard
'
;
import
'
./sleepResumeRepaintMinimap
'
;
src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
0 → 100644
浏览文件 @
7d1cd1ff
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
LifecyclePhase
}
from
'
vs/workbench/services/lifecycle/common/lifecycle
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Extensions
as
WorkbenchExtensions
,
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
}
from
'
vs/workbench/common/contributions
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
IDisplayMainService
}
from
'
vs/platform/display/common/displayMainService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
clearAllFontInfos
}
from
'
vs/editor/browser/config/configuration
'
;
class
DisplayChangeRemeasureFonts
extends
Disposable
implements
IWorkbenchContribution
{
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
super
();
const
displayMainService
=
createChannelSender
<
IDisplayMainService
>
(
mainProcessService
.
getChannel
(
'
display
'
));
displayMainService
.
onDidDisplayChanged
(()
=>
{
clearAllFontInfos
();
});
}
}
Registry
.
as
<
IWorkbenchContributionsRegistry
>
(
WorkbenchExtensions
.
Workbench
).
registerWorkbenchContribution
(
DisplayChangeRemeasureFonts
,
LifecyclePhase
.
Eventually
);
src/vs/workbench/electron-sandbox/window.ts
浏览文件 @
7d1cd1ff
...
...
@@ -59,7 +59,6 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
import
{
IWorkingCopyService
,
WorkingCopyCapabilities
}
from
'
vs/workbench/services/workingCopy/common/workingCopyService
'
;
import
{
AutoSaveMode
,
IFilesConfigurationService
}
from
'
vs/workbench/services/filesConfiguration/common/filesConfigurationService
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
clearAllFontInfos
}
from
'
vs/editor/browser/config/configuration
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
IAddressProvider
,
IAddress
}
from
'
vs/platform/remote/common/remoteAgentConnection
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
...
...
@@ -205,11 +204,6 @@ export class NativeWindow extends Disposable {
choices
));
// Display change events
ipcRenderer
.
on
(
'
vscode:displayChanged
'
,
()
=>
{
clearAllFontInfos
();
});
// Fullscreen Events
ipcRenderer
.
on
(
'
vscode:enterFullScreen
'
,
async
()
=>
{
await
this
.
lifecycleService
.
when
(
LifecyclePhase
.
Ready
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录