Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
90770d23
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,发现更多精彩内容 >>
提交
90770d23
编写于
10月 05, 2016
作者:
T
Tereza Tomcova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Call AllowSetForegroundWindow before sending IPC to the running instance on Windows (Fixes #929)
上级
069984e0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
4 deletion
+46
-4
build/gulpfile.vscode.js
build/gulpfile.vscode.js
+1
-0
npm-shrinkwrap.json
npm-shrinkwrap.json
+5
-0
package.json
package.json
+1
-0
src/typings/windows-foreground-love.d.ts
src/typings/windows-foreground-love.d.ts
+10
-0
src/vs/code/electron-main/launch.ts
src/vs/code/electron-main/launch.ts
+17
-3
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+12
-1
未找到文件。
build/gulpfile.vscode.js
浏览文件 @
90770d23
...
...
@@ -268,6 +268,7 @@ function packageTask(platform, arch, opts) {
.
pipe
(
util
.
cleanNodeModule
(
'
oniguruma
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-mutex
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
native-keymap
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
windows-foreground-love
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
],
[
'
**/*.node
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
gc-signals
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
**/*.node
'
,
'
src/index.js
'
]))
.
pipe
(
util
.
cleanNodeModule
(
'
pty.js
'
,
[
'
binding.gyp
'
,
'
build/**
'
,
'
src/**
'
,
'
deps/**
'
],
[
'
build/Release/**
'
]));
...
...
npm-shrinkwrap.json
浏览文件 @
90770d23
...
...
@@ -414,6 +414,11 @@
"from"
:
"vscode-textmate@2.2.0"
,
"resolved"
:
"https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-2.2.0.tgz"
},
"windows-foreground-love"
:
{
"version"
:
"0.1.0"
,
"from"
:
"windows-foreground-love@0.1.0"
,
"resolved"
:
"https://registry.npmjs.org/windows-foreground-love/-/windows-foreground-love-0.1.0.tgz"
},
"windows-mutex"
:
{
"version"
:
"0.2.0"
,
"from"
:
"windows-mutex@>=0.2.0 <0.3.0"
,
...
...
package.json
浏览文件 @
90770d23
...
...
@@ -108,6 +108,7 @@
}
},
"optionalDependencies"
:
{
"windows-foreground-love"
:
"0.1.0"
,
"windows-mutex"
:
"^0.2.0"
,
"fsevents"
:
"0.3.8"
}
...
...
src/typings/windows-foreground-love.d.ts
0 → 100644
浏览文件 @
90770d23
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare
module
'
windows-foreground-love
'
{
export
function
allowSetForegroundWindow
(
pid
?:
number
):
boolean
;
}
\ No newline at end of file
src/vs/code/electron-main/launch.ts
浏览文件 @
90770d23
...
...
@@ -21,10 +21,12 @@ export interface IStartArguments {
export
interface
ILaunchService
{
start
(
args
:
ParsedArgs
,
userEnv
:
IProcessEnvironment
):
TPromise
<
void
>
;
getMainProcessId
():
TPromise
<
number
>
;
}
export
interface
ILaunchChannel
extends
IChannel
{
call
(
command
:
'
start
'
,
arg
:
IStartArguments
):
TPromise
<
void
>
;
call
(
command
:
'
get-main-process-id
'
,
arg
:
null
):
TPromise
<
any
>
;
call
(
command
:
string
,
arg
:
any
):
TPromise
<
any
>
;
}
...
...
@@ -33,10 +35,13 @@ export class LaunchChannel implements ILaunchChannel {
constructor
(
private
service
:
ILaunchService
)
{
}
call
(
command
:
string
,
arg
:
any
):
TPromise
<
any
>
{
const
{
args
,
userEnv
}
=
arg
as
IStartArguments
;
switch
(
command
)
{
case
'
start
'
:
return
this
.
service
.
start
(
args
,
userEnv
);
case
'
start
'
:
const
{
args
,
userEnv
}
=
arg
as
IStartArguments
;
return
this
.
service
.
start
(
args
,
userEnv
);
case
'
get-main-process-id
'
:
return
this
.
service
.
getMainProcessId
();
}
}
}
...
...
@@ -48,6 +53,10 @@ export class LaunchChannelClient implements ILaunchService {
start
(
args
:
ParsedArgs
,
userEnv
:
IProcessEnvironment
):
TPromise
<
void
>
{
return
this
.
channel
.
call
(
'
start
'
,
{
args
,
userEnv
});
}
getMainProcessId
():
TPromise
<
number
>
{
return
this
.
channel
.
call
(
'
get-main-process-id
'
,
null
);
}
}
export
class
LaunchService
implements
ILaunchService
{
...
...
@@ -105,4 +114,9 @@ export class LaunchService implements ILaunchService {
return
TPromise
.
as
(
null
);
}
getMainProcessId
():
TPromise
<
number
>
{
this
.
logService
.
log
(
'
Received request for process ID from other instance.
'
);
return
TPromise
.
as
(
process
.
pid
);
}
}
\ No newline at end of file
src/vs/code/electron-main/main.ts
浏览文件 @
90770d23
...
...
@@ -25,6 +25,7 @@ import { AskpassChannel } from 'vs/workbench/parts/git/common/gitIpc';
import
{
GitAskpassService
}
from
'
vs/workbench/parts/git/electron-main/askpassService
'
;
import
{
spawnSharedProcess
}
from
'
vs/code/node/sharedProcess
'
;
import
{
Mutex
}
from
'
windows-mutex
'
;
import
{
allowSetForegroundWindow
}
from
'
windows-foreground-love
'
;
import
{
LaunchService
,
ILaunchChannel
,
LaunchChannel
,
LaunchChannelClient
}
from
'
./launch
'
;
import
{
ServicesAccessor
,
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
...
...
@@ -299,7 +300,17 @@ function setupIPC(accessor: ServicesAccessor): TPromise<Server> {
const
channel
=
client
.
getChannel
<
ILaunchChannel
>
(
'
launch
'
);
const
service
=
new
LaunchChannelClient
(
channel
);
return
service
.
start
(
environmentService
.
args
,
process
.
env
)
let
promise
=
TPromise
.
as
(
null
);
if
(
platform
.
isWindows
)
{
promise
=
service
.
getMainProcessId
()
.
then
(
processId
=>
{
logService
.
log
(
'
Sending some foreground love to the running instance:
'
,
processId
);
allowSetForegroundWindow
(
processId
);
});
}
return
promise
.
then
(()
=>
service
.
start
(
environmentService
.
args
,
process
.
env
))
.
then
(()
=>
client
.
dispose
())
.
then
(()
=>
TPromise
.
wrapError
(
'
Sent env to running instance. Terminating...
'
));
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录