Skip to content

Commit

Permalink
Make sure UI loads when minimized.
Browse files Browse the repository at this point in the history
Fixes #13798

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
  • Loading branch information
tsmaeder committed Jul 10, 2024
1 parent a59e073 commit b2cd229
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/browser/shell/split-panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ export class SplitPositionHandler {
move.resolve = resolve;
move.reject = reject;
if (this.splitMoves.length === 0) {
window.requestAnimationFrame(this.animationFrame.bind(this));
setTimeout(this.animationFrame.bind(this), 10);
}
this.splitMoves.push(move);
});
}

protected animationFrame(time: number): void {
protected animationFrame(): void {
const time = Date.now();
const move = this.splitMoves[this.currentMoveIndex];
let rejectedOrResolved = false;
if (move.ended || move.referenceWidget && move.referenceWidget.isHidden) {
Expand Down Expand Up @@ -133,7 +134,7 @@ export class SplitPositionHandler {
this.currentMoveIndex = 0;
}
if (this.splitMoves.length > 0) {
window.requestAnimationFrame(this.animationFrame.bind(this));
setTimeout(this.animationFrame.bind(this));
}
}

Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/electron-main/electron-main-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
// *****************************************************************************

import { inject, injectable, named } from 'inversify';
import { screen, app, BrowserWindow, WebContents, Event as ElectronEvent, BrowserWindowConstructorOptions, nativeImage,
nativeTheme, shell, dialog } from '../../electron-shared/electron';
import {
screen, app, BrowserWindow, WebContents, Event as ElectronEvent, BrowserWindowConstructorOptions, nativeImage,
nativeTheme, shell, dialog
} from '../../electron-shared/electron';
import * as path from 'path';
import { Argv } from 'yargs';
import { AddressInfo } from 'net';
Expand Down Expand Up @@ -350,6 +352,9 @@ export class ElectronMainApplication {
alwaysOnTop: true,
show: false,
transparent: true,
webPreferences: {
backgroundThrottling: false
}
});

if (this.isShowWindowEarly()) {
Expand Down Expand Up @@ -458,6 +463,7 @@ export class ElectronMainApplication {
// Setting the following option to `true` causes some features to break, somehow.
// Issue: https://github.com/eclipse-theia/theia/issues/8577
nodeIntegrationInWorker: false,
backgroundThrottling: false,
preload: path.resolve(this.globals.THEIA_APP_PROJECT_PATH, 'lib', 'frontend', 'preload.js').toString()
},
...this.config.electron?.windowOptions || {},
Expand Down

0 comments on commit b2cd229

Please sign in to comment.