mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
updated window docking logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Injectable, NgZone } from '@angular/core'
|
||||
import { Injectable, NgZone, Inject } from '@angular/core'
|
||||
import type { Display } from 'electron'
|
||||
import { ConfigService, DockingService, Screen, PlatformService } from 'tabby-core'
|
||||
import { ConfigService, DockingService, Screen, PlatformService, BootstrapData, BOOTSTRAP_DATA } from 'tabby-core'
|
||||
import { ElectronService } from '../services/electron.service'
|
||||
import { ElectronHostWindow, Bounds } from './hostWindow.service'
|
||||
|
||||
@@ -12,6 +12,7 @@ export class ElectronDockingService extends DockingService {
|
||||
private zone: NgZone,
|
||||
private hostWindow: ElectronHostWindow,
|
||||
platform: PlatformService,
|
||||
@Inject(BOOTSTRAP_DATA) private bootstrapData: BootstrapData,
|
||||
) {
|
||||
super()
|
||||
this.screensChanged$.subscribe(() => this.repositionWindow())
|
||||
@@ -25,7 +26,7 @@ export class ElectronDockingService extends DockingService {
|
||||
dock (): void {
|
||||
const dockSide = this.config.store.appearance.dock
|
||||
|
||||
if (dockSide === 'off') {
|
||||
if (dockSide === 'off' || !this.bootstrapData.isMainWindow) {
|
||||
this.hostWindow.setAlwaysOnTop(false)
|
||||
return
|
||||
}
|
||||
|
@@ -43,6 +43,10 @@ export class ElectronHostWindow extends HostWindowService {
|
||||
electron.ipcRenderer.on('host:window-focused', () => zone.run(() => {
|
||||
this.windowFocused.next()
|
||||
}))
|
||||
|
||||
electron.ipcRenderer.on('host:became-main-window', () => zone.run(() => {
|
||||
this.bootstrapData.isMainWindow = true
|
||||
}))
|
||||
}
|
||||
|
||||
getWindow (): BrowserWindow {
|
||||
|
Reference in New Issue
Block a user