prevent resizing new floating windows
This commit is contained in:
@@ -31,7 +31,7 @@ class ClientManager {
|
||||
const grid = this.desktopManager.getDesktopForClient(kwinClient).grid;
|
||||
constructState = (client: ClientWrapper) => new ClientState.Tiled(this.world, client, grid);
|
||||
} else {
|
||||
constructState = (client: ClientWrapper) => new ClientState.Floating(client);
|
||||
constructState = (client: ClientWrapper) => new ClientState.Floating(client, false);
|
||||
}
|
||||
|
||||
const client = new ClientWrapper(
|
||||
@@ -105,7 +105,7 @@ class ClientManager {
|
||||
return;
|
||||
}
|
||||
if (client.stateManager.getState() instanceof ClientState.Tiled) {
|
||||
client.stateManager.setState(() => new ClientState.Floating(client), false);
|
||||
client.stateManager.setState(() => new ClientState.Floating(client, true), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ class ClientManager {
|
||||
const grid = this.desktopManager.getDesktopForClient(client.kwinClient).grid;
|
||||
client.stateManager.setState(() => new ClientState.Tiled(this.world, client, grid), false);
|
||||
} else if (clientState instanceof ClientState.Tiled) {
|
||||
client.stateManager.setState(() => new ClientState.Floating(client), false);
|
||||
client.stateManager.setState(() => new ClientState.Floating(client, true), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
namespace ClientState {
|
||||
export class Floating implements State {
|
||||
constructor(client: ClientWrapper) {
|
||||
if (client.kwinClient.tile === null) {
|
||||
Floating.prepareClientForFloating(client);
|
||||
constructor(client: ClientWrapper, limitHeight: boolean) {
|
||||
if (limitHeight && client.kwinClient.tile === null) {
|
||||
Floating.limitHeight(client);
|
||||
}
|
||||
}
|
||||
|
||||
public destroy(passFocus: boolean) {}
|
||||
|
||||
private static prepareClientForFloating(client: ClientWrapper) {
|
||||
private static limitHeight(client: ClientWrapper) {
|
||||
const placementArea = workspace.clientArea(ClientAreaOption.PlacementArea, client.kwinClient.screen, client.kwinClient.desktop);
|
||||
const clientRect = client.kwinClient.frameGeometry;
|
||||
const width = client.preferredWidth;
|
||||
|
||||
Reference in New Issue
Block a user