mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-23 10:32:29 +03:00
prevent window controls flickering
This commit is contained in:
parent
39786e023e
commit
c7589acc87
@ -44,6 +44,7 @@ export class Window {
|
|||||||
private configStore: any
|
private configStore: any
|
||||||
private touchBarControl: any
|
private touchBarControl: any
|
||||||
private isFluentVibrancy = false
|
private isFluentVibrancy = false
|
||||||
|
private dockHidden = false
|
||||||
|
|
||||||
get visible$ (): Observable<boolean> { return this.visible }
|
get visible$ (): Observable<boolean> { return this.visible }
|
||||||
get closed$ (): Observable<void> { return this.closed }
|
get closed$ (): Observable<void> { return this.closed }
|
||||||
@ -248,18 +249,34 @@ export class Window {
|
|||||||
private async enableDockedWindowStyles (enabled: boolean) {
|
private async enableDockedWindowStyles (enabled: boolean) {
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
if (!this.dockHidden) {
|
||||||
app.dock.hide()
|
app.dock.hide()
|
||||||
|
this.dockHidden = true
|
||||||
|
}
|
||||||
this.window.setAlwaysOnTop(true, 'screen-saver', 1)
|
this.window.setAlwaysOnTop(true, 'screen-saver', 1)
|
||||||
|
if (!this.window.isVisibleOnAllWorkspaces()) {
|
||||||
this.window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true })
|
this.window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true })
|
||||||
|
}
|
||||||
|
if (this.window.fullScreenable) {
|
||||||
this.window.setFullScreenable(false)
|
this.window.setFullScreenable(false)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (this.dockHidden) {
|
||||||
await app.dock.show()
|
await app.dock.show()
|
||||||
|
this.dockHidden = false
|
||||||
|
}
|
||||||
|
if (this.window.isAlwaysOnTop()) {
|
||||||
this.window.setAlwaysOnTop(false)
|
this.window.setAlwaysOnTop(false)
|
||||||
|
}
|
||||||
|
if (this.window.isVisibleOnAllWorkspaces()) {
|
||||||
this.window.setVisibleOnAllWorkspaces(false)
|
this.window.setVisibleOnAllWorkspaces(false)
|
||||||
|
}
|
||||||
|
if (!this.window.fullScreenable) {
|
||||||
this.window.setFullScreenable(true)
|
this.window.setFullScreenable(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private setupWindowManagement () {
|
private setupWindowManagement () {
|
||||||
this.window.on('show', () => {
|
this.window.on('show', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user