prevent off-screen transients (fixes #11)
This commit is contained in:
@@ -127,6 +127,7 @@ class ScrollView {
|
||||
// TODO (optimization): only arrange visible windows
|
||||
this.updateArea();
|
||||
this.grid.arrange(this.tilingArea.x - this.scrollX);
|
||||
this.world.ensureFocusedTransientsVisible(); // TODO: refactor - call from elsewhere
|
||||
}
|
||||
|
||||
public onGridWidthChanged() {
|
||||
|
||||
@@ -119,6 +119,25 @@ class ClientWrapper {
|
||||
this.transients.splice(i, 1);
|
||||
}
|
||||
|
||||
public ensureTransientsVisible(screenSize: QRect) {
|
||||
for (const transient of this.transients) {
|
||||
if (transient.stateManager.getState() instanceof ClientStateFloating) {
|
||||
transient.ensureVisible(screenSize);
|
||||
transient.ensureTransientsVisible(screenSize);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ensureVisible(screenSize: QRect) {
|
||||
const frame = this.kwinClient.frameGeometry;
|
||||
if (frame.left < 0) {
|
||||
frame.x = 0;
|
||||
} else if (frame.right > screenSize.width) {
|
||||
frame.x = screenSize.width - frame.width;
|
||||
}
|
||||
}
|
||||
|
||||
destroy(passFocus: boolean) {
|
||||
this.stateManager.destroy(passFocus);
|
||||
this.signalManager.destroy();
|
||||
|
||||
@@ -113,6 +113,12 @@ class World {
|
||||
return transientFor;
|
||||
}
|
||||
|
||||
public ensureFocusedTransientsVisible() {
|
||||
this.doIfTiledFocused(true, (window, column, grid) => {
|
||||
window.client.ensureTransientsVisible(grid.container.clientArea);
|
||||
});
|
||||
}
|
||||
|
||||
minimizeClient(kwinClient: AbstractClient) {
|
||||
const client = this.clientMap.get(kwinClient);
|
||||
if (client === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user