Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cc1ba3c0
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,体验更适合开发者的 AI 搜索 >>
提交
cc1ba3c0
编写于
12月 12, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add tracing for #86771
上级
a4177f50
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
12 addition
and
1 deletion
+12
-1
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+9
-0
src/vs/platform/windows/electron-main/windowsMainService.ts
src/vs/platform/windows/electron-main/windowsMainService.ts
+3
-1
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
cc1ba3c0
...
...
@@ -114,6 +114,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
// Load window state
const
[
state
,
hasMultipleDisplays
]
=
this
.
restoreWindowState
(
config
.
state
);
this
.
windowState
=
state
;
this
.
logService
.
trace
(
'
window#ctor: using window state
'
,
state
);
// in case we are maximized or fullscreen, only show later after the call to maximize/fullscreen (see below)
const
isFullscreenOrMaximized
=
(
this
.
windowState
.
mode
===
WindowMode
.
Maximized
||
this
.
windowState
.
mode
===
WindowMode
.
Fullscreen
);
...
...
@@ -782,10 +783,12 @@ export class CodeWindow extends Disposable implements ICodeWindow {
||
typeof
state
.
width
!==
'
number
'
||
typeof
state
.
height
!==
'
number
'
)
{
this
.
logService
.
trace
(
'
window#validateWindowState: unexpected type of state values
'
);
return
undefined
;
}
if
(
state
.
width
<=
0
||
state
.
height
<=
0
)
{
this
.
logService
.
trace
(
'
window#validateWindowState: unexpected negative values
'
);
return
undefined
;
}
...
...
@@ -793,6 +796,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
if
(
displays
.
length
===
1
)
{
const
displayWorkingArea
=
this
.
getWorkingArea
(
displays
[
0
]);
if
(
displayWorkingArea
)
{
this
.
logService
.
trace
(
'
window#validateWindowState: 1 display
'
,
displayWorkingArea
);
if
(
state
.
x
<
displayWorkingArea
.
x
)
{
state
.
x
=
displayWorkingArea
.
x
;
// prevent window from falling out of the screen to the left
}
...
...
@@ -825,6 +830,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
if
(
state
.
display
&&
state
.
mode
===
WindowMode
.
Fullscreen
)
{
const
display
=
displays
.
filter
(
d
=>
d
.
id
===
state
.
display
)[
0
];
if
(
display
&&
typeof
display
.
bounds
?.
x
===
'
number
'
&&
typeof
display
.
bounds
?.
y
===
'
number
'
)
{
this
.
logService
.
trace
(
'
window#validateWindowState: restoring fullscreen to previous display
'
);
const
defaults
=
defaultWindowState
(
WindowMode
.
Fullscreen
);
// make sure we have good values when the user restores the window
defaults
.
x
=
display
.
bounds
.
x
;
// carefull to use displays x/y position so that the window ends up on the correct monitor
defaults
.
y
=
display
.
bounds
.
y
;
...
...
@@ -845,6 +852,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
bounds
.
x
+
bounds
.
width
>
displayWorkingArea
.
x
&&
// prevent window from falling out of the screen to the left
bounds
.
y
+
bounds
.
height
>
displayWorkingArea
.
y
// prevent window from falling out of the scree nto the top
)
{
this
.
logService
.
trace
(
'
window#validateWindowState: multi display
'
,
displayWorkingArea
);
return
state
;
}
...
...
src/vs/platform/windows/electron-main/windowsMainService.ts
浏览文件 @
cc1ba3c0
...
...
@@ -326,7 +326,9 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
}
// Persist
this
.
stateService
.
setItem
(
WindowsMainService
.
windowsStateStorageKey
,
getWindowsStateStoreData
(
currentWindowsState
));
const
state
=
getWindowsStateStoreData
(
currentWindowsState
);
this
.
logService
.
trace
(
'
onBeforeShutdown
'
,
state
);
this
.
stateService
.
setItem
(
WindowsMainService
.
windowsStateStorageKey
,
state
);
}
// See note on #onBeforeShutdown() for details how these events are flowing
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录