@theia/core 1.20.0 → 1.21.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/browser/common-frontend-contribution.d.ts +1 -13
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +86 -127
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +6 -5
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/preferences/preference-provider.d.ts +0 -2
- package/lib/browser/preferences/preference-provider.d.ts.map +1 -1
- package/lib/browser/preferences/preference-provider.js +1 -5
- package/lib/browser/preferences/preference-provider.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +0 -3
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/shell/application-shell.d.ts +7 -7
- package/lib/browser/shell/application-shell.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +10 -17
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/current-widget-command-adapter.d.ts +39 -0
- package/lib/browser/shell/current-widget-command-adapter.d.ts.map +1 -0
- package/lib/browser/shell/current-widget-command-adapter.js +42 -0
- package/lib/browser/shell/current-widget-command-adapter.js.map +1 -0
- package/lib/browser/shell/tab-bars.d.ts +8 -2
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +30 -3
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/common/promise-util.d.ts +3 -0
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js +16 -1
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/promise-util.spec.d.ts +2 -0
- package/lib/common/promise-util.spec.d.ts.map +1 -0
- package/lib/common/promise-util.spec.js +42 -0
- package/lib/common/promise-util.spec.js.map +1 -0
- package/lib/electron-main/electron-main-application.d.ts +10 -0
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +13 -3
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/package.json +3 -3
- package/src/browser/common-frontend-contribution.ts +75 -132
- package/src/browser/frontend-application-module.ts +6 -5
- package/src/browser/preferences/preference-provider.ts +1 -5
- package/src/browser/preferences/preference-service.spec.ts +0 -3
- package/src/browser/shell/application-shell.ts +17 -22
- package/src/browser/shell/current-widget-command-adapter.ts +57 -0
- package/src/browser/shell/tab-bars.ts +30 -5
- package/src/common/promise-util.spec.ts +41 -0
- package/src/common/promise-util.ts +20 -1
- package/src/electron-main/electron-main-application.ts +24 -5
|
@@ -42,6 +42,12 @@ const createYargs: (argv?: string[], cwd?: string) => Argv = require('yargs/yarg
|
|
|
42
42
|
export interface TheiaBrowserWindowOptions extends BrowserWindowConstructorOptions {
|
|
43
43
|
isMaximized?: boolean;
|
|
44
44
|
isFullScreen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Represents the complete screen layout for all available displays.
|
|
47
|
+
* This field is used to determine if the layout was updated since the electron window was last opened,
|
|
48
|
+
* in which case we want to invalidate the stored options and use the default options instead.
|
|
49
|
+
*/
|
|
50
|
+
screenLayout?: string;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
/**
|
|
@@ -254,11 +260,14 @@ export class ElectronMainApplication {
|
|
|
254
260
|
}
|
|
255
261
|
|
|
256
262
|
async getLastWindowOptions(): Promise<TheiaBrowserWindowOptions> {
|
|
257
|
-
const
|
|
263
|
+
const previousWindowState: TheiaBrowserWindowOptions | undefined = this.electronStore.get('windowstate');
|
|
264
|
+
const windowState = previousWindowState?.screenLayout === this.getCurrentScreenLayout()
|
|
265
|
+
? previousWindowState
|
|
266
|
+
: this.getDefaultTheiaWindowOptions();
|
|
258
267
|
return {
|
|
259
268
|
frame: this.useNativeWindowFrame,
|
|
260
|
-
...
|
|
261
|
-
...
|
|
269
|
+
...this.getDefaultOptions(),
|
|
270
|
+
...windowState
|
|
262
271
|
};
|
|
263
272
|
}
|
|
264
273
|
|
|
@@ -403,13 +412,23 @@ export class ElectronMainApplication {
|
|
|
403
412
|
height: bounds.height,
|
|
404
413
|
x: bounds.x,
|
|
405
414
|
y: bounds.y,
|
|
406
|
-
frame: this.useNativeWindowFrame
|
|
407
|
-
|
|
415
|
+
frame: this.useNativeWindowFrame,
|
|
416
|
+
screenLayout: this.getCurrentScreenLayout(),
|
|
417
|
+
} as TheiaBrowserWindowOptions);
|
|
408
418
|
} catch (e) {
|
|
409
419
|
console.error('Error while saving window state:', e);
|
|
410
420
|
}
|
|
411
421
|
}
|
|
412
422
|
|
|
423
|
+
/**
|
|
424
|
+
* Return a string unique to the current display layout.
|
|
425
|
+
*/
|
|
426
|
+
protected getCurrentScreenLayout(): string {
|
|
427
|
+
return screen.getAllDisplays().map(
|
|
428
|
+
display => `${display.bounds.x}:${display.bounds.y}:${display.bounds.width}:${display.bounds.height}`
|
|
429
|
+
).sort().join('-');
|
|
430
|
+
}
|
|
431
|
+
|
|
413
432
|
/**
|
|
414
433
|
* Catch certain keybindings to prevent reloading the window using keyboard shortcuts.
|
|
415
434
|
*/
|