diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/packages/desktop/src/main/window-controller.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/packages/desktop/src/main/window-controller.js b/gui/packages/desktop/src/main/window-controller.js index 704f9bae3e..ab32b1d6b7 100644 --- a/gui/packages/desktop/src/main/window-controller.js +++ b/gui/packages/desktop/src/main/window-controller.js @@ -130,6 +130,8 @@ class AttachedToTrayWindowPositioning implements WindowPositioning { export default class WindowController { _window: BrowserWindow; + _width: number; + _height: number; _windowPositioning: WindowPositioning; _isWindowReady = false; @@ -139,6 +141,9 @@ export default class WindowController { constructor(window: BrowserWindow, tray: Tray) { this._window = window; + const [width, height] = window.getSize(); + this._width = width; + this._height = height; if (process.platform === 'linux') { this._windowPositioning = new StandaloneWindowPositioning(); @@ -204,8 +209,20 @@ export default class WindowController { this._updatePosition(); this._notifyUpdateWindowShape(); } + + // On linux, the window won't be properly rescaled back to it's original + // size if the DPI scaling factor is changed. + // https://github.com/electron/electron/issues/11050 + if (process.platform === 'linux' && changedMetrics.includes('scaleFactor')) + { + this._forceResizeWindow(); + } }; + _forceResizeWindow() { + this._window.setSize(this._width, this._height); + } + _installWindowReadyHandlers() { this._window.once('ready-to-show', () => { this._isWindowReady = true; |
