Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 11 additions & 4 deletions electron/desktopWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,19 @@ export class DesktopWindowManager {
return { action: 'deny' };
});

this.mainWindow.on('resize', () => {
this.viewHost.resizeActiveView();
this.syncSettingsWindowBounds();
});
// Every way the content area can change size. 'resize' alone misses a
// move to a screen with a different scaling factor, and maximising does
// not reliably report its final size through 'resize' either - the view
// then keeps the old width and the page hangs over the right edge.
for (const event of ['resize', 'maximize', 'unmaximize', 'enter-full-screen', 'leave-full-screen']) {
this.mainWindow.on(event, () => {
this.viewHost.resizeActiveView();
this.syncSettingsWindowBounds();
});
}

this.mainWindow.on('move', () => {
this.viewHost.resizeActiveView();
this.syncSettingsWindowBounds();
});

Expand Down
6 changes: 5 additions & 1 deletion electron/viewHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,12 @@ export class ViewHost {
} catch {
return;
}
// No setAutoResize here. It grows the view along with the window on its
// own, and `resizeActiveView` below already sets the bounds on every
// resize - the two together let the view end up wider than the window,
// which cuts the page off at the right edge with no scrollbar to hint at
// it. Setting the bounds by hand covers every case setAutoResize would.
view.setBounds(this.getContentViewBounds());
view.setAutoResize({ width: true, height: true });
}

resizeActiveView() {
Expand Down