fixed docked window overlapping the Windows taskbar - fixes #5799, fixes #3522, fixes #4839, fixes #2900

This commit is contained in:
Eugene Pankov 2022-02-23 20:23:25 +01:00
parent 2b12f89f31
commit 5caa4d14f5
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -45,26 +45,26 @@ export class ElectronDockingService extends DockingService {
const [minWidth, minHeight] = this.hostWindow.getWindow().getMinimumSize()
if (dockSide === 'left' || dockSide === 'right') {
newBounds.width = Math.max(minWidth, Math.round(fill * display.bounds.width))
newBounds.height = Math.round(display.bounds.height * space)
newBounds.width = Math.max(minWidth, Math.round(fill * display.workArea.width))
newBounds.height = Math.round(display.workArea.height * space)
}
if (dockSide === 'top' || dockSide === 'bottom') {
newBounds.width = Math.round(display.bounds.width * space)
newBounds.height = Math.max(minHeight, Math.round(fill * display.bounds.height))
newBounds.width = Math.round(display.workArea.width * space)
newBounds.height = Math.max(minHeight, Math.round(fill * display.workArea.height))
}
if (dockSide === 'right') {
newBounds.x = display.bounds.x + display.bounds.width - newBounds.width
newBounds.x = display.workArea.x + display.workArea.width - newBounds.width
} else if (dockSide === 'left') {
newBounds.x = display.bounds.x
newBounds.x = display.workArea.x
} else {
newBounds.x = display.bounds.x + Math.round(display.bounds.width / 2 * (1 - space))
newBounds.x = display.workArea.x + Math.round(display.workArea.width / 2 * (1 - space))
}
if (dockSide === 'bottom') {
newBounds.y = display.bounds.y + display.bounds.height - newBounds.height
newBounds.y = display.workArea.y + display.workArea.height - newBounds.height
} else if (dockSide === 'top') {
newBounds.y = display.bounds.y
newBounds.y = display.workArea.y
} else {
newBounds.y = display.bounds.y + Math.round(display.bounds.height / 2 * (1 - space))
newBounds.y = display.workArea.y + Math.round(display.workArea.height / 2 * (1 - space))
}
const alwaysOnTop = this.config.store.appearance.dockAlwaysOnTop