mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-11 00:15:37 +03:00
This commit is contained in:
parent
49ac131044
commit
502f812081
@ -243,19 +243,17 @@ export class TilingController implements Controller {
|
|||||||
this.engine.arrange();
|
this.engine.arrange();
|
||||||
|
|
||||||
// Switch to next window if monocle with config.monocleMinimizeRest
|
// Switch to next window if monocle with config.monocleMinimizeRest
|
||||||
try {
|
if (
|
||||||
if (!this.currentWindow && this.engine.isLayoutMonocleAndMinimizeRest()) {
|
!window.window.isDialog &&
|
||||||
this.engine.focusOrder(1, true);
|
!this.currentWindow &&
|
||||||
/* HACK: force window to maximize if it isn't already
|
this.engine.isLayoutMonocleAndMinimizeRest()
|
||||||
* This is ultimately to trigger onWindowFocused() at the right time
|
) {
|
||||||
*/
|
this.engine.focusOrder(1, true);
|
||||||
this.engine.focusOrder(1, true);
|
/* HACK: force window to maximize if it isn't already
|
||||||
this.engine.focusOrder(-1, true);
|
* This is ultimately to trigger onWindowFocused() at the right time
|
||||||
}
|
*/
|
||||||
} catch {
|
this.engine.focusOrder(1, true);
|
||||||
/* HACK for the HACK: transient modals cause an error with the above workaround,
|
this.engine.focusOrder(-1, true);
|
||||||
* so if we catch it here and ignore it, all is well */
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,25 +350,29 @@ export class TilingController implements Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public onWindowFocused(window: Window): void {
|
public onWindowFocused(window: Window): void {
|
||||||
window.timestamp = new Date().getTime();
|
try {
|
||||||
this.currentWindow = window;
|
window.timestamp = new Date().getTime();
|
||||||
// Minimize other windows if Monocle and config.monocleMinimizeRest
|
this.currentWindow = window;
|
||||||
if (
|
// Minimize other windows if Monocle and config.monocleMinimizeRest
|
||||||
this.engine.isLayoutMonocleAndMinimizeRest() &&
|
if (
|
||||||
this.engine.windows.getVisibleTiles(window.surface).includes(window)
|
this.engine.isLayoutMonocleAndMinimizeRest() &&
|
||||||
) {
|
this.engine.windows.getVisibleTiles(window.surface).includes(window)
|
||||||
/* If a window hasn't been focused in this layout yet, ensure its geometry
|
) {
|
||||||
* gets maximized.
|
/* If a window hasn't been focused in this layout yet, ensure its geometry
|
||||||
*/
|
* gets maximized.
|
||||||
this.engine
|
*/
|
||||||
.currentLayoutOnCurrentSurface()
|
this.engine
|
||||||
.apply(
|
.currentLayoutOnCurrentSurface()
|
||||||
this,
|
.apply(
|
||||||
this.engine.windows.getAllTileables(window.surface),
|
this,
|
||||||
window.surface.workingArea
|
this.engine.windows.getAllTileables(window.surface),
|
||||||
);
|
window.surface.workingArea
|
||||||
|
);
|
||||||
|
|
||||||
this.engine.minimizeOthers(window);
|
this.engine.minimizeOthers(window);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ export interface DriverWindow {
|
|||||||
readonly shouldFloat: boolean;
|
readonly shouldFloat: boolean;
|
||||||
readonly screen: number;
|
readonly screen: number;
|
||||||
readonly active: boolean;
|
readonly active: boolean;
|
||||||
|
readonly isDialog: boolean;
|
||||||
surface: DriverSurface;
|
surface: DriverSurface;
|
||||||
minimized: boolean;
|
minimized: boolean;
|
||||||
shaded: boolean;
|
shaded: boolean;
|
||||||
@ -261,4 +262,8 @@ export class KWinWindow implements DriverWindow {
|
|||||||
|
|
||||||
return new Rect(geometry.x, geometry.y, width, height);
|
return new Rect(geometry.x, geometry.y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get isDialog(): boolean {
|
||||||
|
return this.client.dialog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user