Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to electron 1.6.x #23800

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d42d446
electron 1.6.2
bpasero Mar 2, 2017
2ec9f79
electron 1.6.3
bpasero Mar 17, 2017
418085f
Merge branch 'master' into ben/electron
bpasero Mar 17, 2017
7315001
Merge branch 'master' into ben/electron
bpasero Mar 18, 2017
1af335a
Merge branch 'master' into ben/electron
bpasero Mar 18, 2017
27d2632
Merge branch 'master' into ben/electron
bpasero Mar 23, 2017
e456867
electron 1.6.4
bpasero Mar 23, 2017
971d605
Merge branch 'master' into ben/electron
bpasero Mar 28, 2017
8b99116
Merge branch 'master' into ben/electron
bpasero Mar 30, 2017
7dd803d
listen to auxclick for mouse button 2 and 3 support
bpasero Mar 30, 2017
6d0c3b5
disable auxclick altogether via webPreferences
bpasero Mar 30, 2017
54e37f6
more elegant way of disabling blink features for webview
bpasero Mar 30, 2017
774933d
Merge branch 'master' into ben/electron
bpasero Mar 31, 2017
dcf4fc5
electron 1.6.5
bpasero Mar 31, 2017
31d0af3
Merge branch 'master' into ben/electron
bpasero Mar 31, 2017
f76d160
more timeout for failing test
bpasero Apr 1, 2017
81c82a9
OSS input
bpasero Apr 1, 2017
440b1b8
tweak timeout
bpasero Apr 1, 2017
fc7f97d
Merge branch 'master' into ben/electron
bpasero Apr 2, 2017
094800e
Add an option 'nativeTabs' (for #15478)
bpasero Apr 2, 2017
7569bb8
applicationinsights 0.17.1 (os.tmpdir deprecation fix)
bpasero Apr 3, 2017
7104f57
Set relaunch command for window (for #13905)
the-ress Apr 3, 2017
399103d
Windows: rename casing of file shows "file deleted on disk" in editor…
bpasero Apr 3, 2017
02cdb94
SCM: Text-only navigation action misaligned (fixes #23583)
bpasero Apr 3, 2017
f643b27
Adopt menu service and commands for save conflict actions (for #23420…
bpasero Apr 3, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ before_install:
- git submodule update --init --recursive
- git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm
- source ./.nvm/nvm.sh
- nvm install 6.6.0
- nvm use 6.6.0
- nvm install 7.4.0
- nvm use 7.4.0
- npm config set python `which python`
- npm install -g gulp
- if [ $TRAVIS_OS_NAME == "linux" ]; then
Expand Down
6 changes: 3 additions & 3 deletions OSSREADME.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
{
"name": "chromium",
"version": "53.0.2785.143",
"version": "56.0.2924.87",
"repositoryURL": "http://www.chromium.org/Home",
"licenseDetail": [
"BSD License",
Expand Down Expand Up @@ -104,14 +104,14 @@
},
{
"name": "libchromiumcontent",
"version": "53.0.2785.143",
"version": "56.0.2924.87",
"license": "MIT",
"repositoryURL": "https://github.com/electron/libchromiumcontent",
"isProd": true
},
{
"name": "nodejs",
"version": "6.5.0",
"version": "7.4.0",
"repositoryURL": "https://github.com/nodejs/node",
"isProd": true
},
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ environment:
VSCODE_BUILD_VERBOSE: true

install:
- ps: Install-Product node 6.6.0 x64
- ps: Install-Product node 7.4.0 x64
- npm install -g npm --silent
- npm install -g gulp mocha --silent

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.12.0",
"electronVersion": "1.4.6",
"electronVersion": "1.6.5",
"distro": "fbef8e6a73f122b5c8b0034e2c1549e00a1815c3",
"author": {
"name": "Microsoft Corporation"
Expand Down
5 changes: 5 additions & 0 deletions src/typings/electron.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,11 @@ declare namespace Electron {
* Settings of web page’s features.
*/
webPreferences?: WebPreferences;
/**
* Tab group name, allows opening the window as a native tab on macOS 10.12+.
* Windows with the same tabbing identifier will be grouped together.
*/
tabbingIdentifier?: string;
}

type BrowserWindowType = BrowserWindowTypeLinux | BrowserWindowTypeMac | BrowserWindowTypeWindows;
Expand Down
1 change: 1 addition & 0 deletions src/vs/base/browser/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ export function isHTMLElement(o: any): o is HTMLElement {
export const EventType = {
// Mouse
CLICK: 'click',
AUXCLICK: 'auxclick', // >= Chrome 56
DBLCLICK: 'dblclick',
MOUSE_UP: 'mouseup',
MOUSE_DOWN: 'mousedown',
Expand Down
1 change: 1 addition & 0 deletions src/vs/base/parts/tree/browser/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ export class TreeView extends HeightMap {
this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mousedown', (e) => this.onMouseDown(e)));
this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'mouseup', (e) => this.onMouseUp(e)));
this.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'click', (e) => this.onClick(e)));
this.viewListeners.push(DOM.addDisposableListener(this.wrapper, 'auxclick', (e) => this.onClick(e))); // >= Chrome 56
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If AUXCLICK is getting disabled, why add an event listener for the event type?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auchenberg our code is not just running in VS Code, see also https://github.com/Microsoft/monaco-editor

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense. Just found it puzzling.

this.viewListeners.push(DOM.addDisposableListener(this.domNode, 'contextmenu', (e) => this.onContextMenu(e)));
this.viewListeners.push(DOM.addDisposableListener(this.wrapper, Touch.EventType.Tap, (e) => this.onTap(e)));
this.viewListeners.push(DOM.addDisposableListener(this.wrapper, Touch.EventType.Change, (e) => this.onTouchChange(e)));
Expand Down
18 changes: 15 additions & 3 deletions src/vs/code/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface IWindowCreationOptions {
state: IWindowState;
extensionDevelopmentPath?: string;
isExtensionTestHost?: boolean;
titleBarStyle?: 'native' | 'custom';
}

export enum WindowMode {
Expand Down Expand Up @@ -190,22 +189,35 @@ export class VSCodeWindow {
show: !isFullscreenOrMaximized,
title: product.nameLong,
webPreferences: {
'backgroundThrottling': false // by default if Code is in the background, intervals and timeouts get throttled
'backgroundThrottling': false, // by default if Code is in the background, intervals and timeouts get throttled,
disableBlinkFeatures: 'Auxclick' // disable auxclick events (see https://developers.google.com/web/updates/2016/10/auxclick)
}
};

if (platform.isLinux) {
options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s)
}

const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');

let useNativeTabs = false;
if (windowConfig && windowConfig.nativeTabs) {
options.tabbingIdentifier = product.nameShort; // this opts in to sierra tabs
useNativeTabs = true;
}

let useCustomTitleStyle = false;
if (platform.isMacintosh && (!this.options.titleBarStyle || this.options.titleBarStyle === 'custom')) {
if (platform.isMacintosh && (!windowConfig || !windowConfig.titleBarStyle || windowConfig.titleBarStyle === 'custom')) {
const isDev = !this.environmentService.isBuilt || !!config.extensionDevelopmentPath;
if (!isDev) {
useCustomTitleStyle = true; // not enabled when developing due to https://github.com/electron/electron/issues/3647
}
}

if (useNativeTabs) {
useCustomTitleStyle = false; // native tabs on sierra do not work with custom title style
}

if (useCustomTitleStyle) {
options.titleBarStyle = 'hidden';
this.hiddenTitleBarStyle = true;
Expand Down
3 changes: 1 addition & 2 deletions src/vs/code/electron-main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,7 @@ export class WindowsManager implements IWindowsMainService {
vscodeWindow = new VSCodeWindow({
state,
extensionDevelopmentPath: configuration.extensionDevelopmentPath,
isExtensionTestHost: !!configuration.extensionTestsPath,
titleBarStyle: windowConfig ? windowConfig.titleBarStyle : void 0
isExtensionTestHost: !!configuration.extensionTestsPath
},
this.logService,
this.environmentService,
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/windows/common/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,5 @@ export interface IWindowSettings {
autoDetectHighContrast: boolean;
menuBarVisibility: MenuBarVisibility;
newWindowDimensions: 'default' | 'inherit' | 'maximized' | 'fullscreen';
nativeTabs: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class NoTabsTitleControl extends TitleControl {

// Detect mouse click
this.toUnbind.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.CLICK, (e: MouseEvent) => this.onTitleClick(e)));
this.toUnbind.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.AUXCLICK, (e: MouseEvent) => this.onTitleClick(e)));

// Editor Label
this.editorLabel = this.instantiationService.createInstance(EditorLabel, this.titleContainer, void 0);
Expand Down
10 changes: 10 additions & 0 deletions src/vs/workbench/electron-browser/main.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import { Registry } from 'vs/platform/platform';
import nls = require('vs/nls');
import product from 'vs/platform/node/product';
import * as os from 'os';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry';
Expand Down Expand Up @@ -269,6 +270,15 @@ if (isMacintosh) {
'default': 'custom',
'description': nls.localize('titleBarStyle', "Adjust the appearance of the window title bar. Changes require a full restart to apply.")
};

// macOS Sierra (10.12.x = darwin 16.x) only
if (os.release().indexOf('16.') === 0) {
properties['window.nativeTabs'] = {
'type': 'boolean',
'default': false,
'description': nls.localize('window.nativeTabs', "Enables macOS Sierra window tabs. Note that changes require a full restart to apply and that native tabs will disable a custom title bar style if configured.")
};
}
}

configurationRegistry.registerConfiguration({
Expand Down
13 changes: 9 additions & 4 deletions src/vs/workbench/electron-browser/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,16 @@ export class Workbench implements IPartService {
}

const windowConfig = this.configurationService.getConfiguration<IWindowConfiguration>();
if (windowConfig && windowConfig.window) {
const useNativeTabs = windowConfig.window.nativeTabs;
if (useNativeTabs) {
return null; // native tabs on sierra do not work with custom title style
}

const style = windowConfig && windowConfig.window && windowConfig.window.titleBarStyle;

if (style === 'custom') {
return style;
const style = windowConfig.window.titleBarStyle;
if (style === 'custom') {
return style;
}
}

return null;
Expand Down
3 changes: 3 additions & 0 deletions src/vs/workbench/parts/html/browser/webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export default class Webview {
this._webview.style.opacity = '0';
this._webview.autoSize = 'on';

// disable auxclick events (see https://developers.google.com/web/updates/2016/10/auxclick)
this._webview.setAttribute('disableblinkfeatures', 'Auxclick');

this._webview.preload = require.toUrl('./webview-pre.js');
this._webview.src = require.toUrl('./webview.html');

Expand Down
3 changes: 2 additions & 1 deletion src/vs/workbench/parts/output/test/bufferedContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ suite('Workbench - Output Buffered Content', () => {
assert.equal(bufferedContent.getDelta(secondDelta).value, 'fourthfifth');
});

test('Buffered Content - Lots of Output', () => {
test('Buffered Content - Lots of Output', function () {
this.timeout(10000);
const bufferedContent = new BufferedContent();
bufferedContent.append('first line');
const firstDelta = bufferedContent.getDelta();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ suite('Files - TextFileEditorModel', () => {
model.load().done(() => {
model.textEditorModel.setValue('foo');

return TPromise.timeout(50).then(() => {
return TPromise.timeout(100).then(() => {
assert.ok(!model.isDirty());
assert.equal(eventCounter, 2);

Expand Down