allow tiling windows that start in full-screen (fixes #79)
This commit is contained in:
@@ -5,8 +5,8 @@ namespace Clients {
|
||||
];
|
||||
|
||||
export function canTileEver(kwinClient: KwinClient) {
|
||||
return kwinClient.moveable &&
|
||||
kwinClient.resizeable &&
|
||||
const shapeable = (kwinClient.moveable && kwinClient.resizeable) || kwinClient.fullScreen; // full-screen windows may become shapeable after exiting full-screen mode
|
||||
return shapeable &&
|
||||
!kwinClient.popupWindow &&
|
||||
!prohibitedClasses.includes(kwinClient.resourceClass);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,15 @@ namespace ClientState {
|
||||
});
|
||||
|
||||
manager.connect(kwinClient.fullScreenChanged, () => {
|
||||
world.do(() => window.onFullScreenChanged(kwinClient.fullScreen));
|
||||
world.do((clientManager, desktopManager) => {
|
||||
// some clients only turn out to be untileable after exiting full-screen mode
|
||||
if (!Clients.canTileEver(kwinClient)) {
|
||||
clientManager.floatClient(client);
|
||||
return;
|
||||
}
|
||||
|
||||
window.onFullScreenChanged(kwinClient.fullScreen);
|
||||
});
|
||||
});
|
||||
|
||||
manager.connect(kwinClient.tileChanged, () => {
|
||||
|
||||
@@ -4,6 +4,7 @@ tests.register("Clients.canTileEver", 1, () => {
|
||||
{ clientProperties: { resourceClass: "app", caption: "Title", moveable: false }, tileable: false },
|
||||
{ clientProperties: { resourceClass: "app", caption: "Caption", resizeable: false }, tileable: false },
|
||||
{ clientProperties: { resourceClass: "app", caption: "Caption", normalWindow: false, popupWindow: true }, tileable: false },
|
||||
{ clientProperties: { resourceClass: "app", caption: "Caption", moveable: false, resizeable: false, fullScreen: true }, tileable: true },
|
||||
{ clientProperties: { resourceClass: "ksmserver-logout-greeter", caption: "Caption" }, tileable: false },
|
||||
{ clientProperties: { resourceClass: "xwaylandvideobridge", caption: "" }, tileable: false },
|
||||
];
|
||||
@@ -24,6 +25,7 @@ tests.register("Clients.canTileEver", 1, () => {
|
||||
pid: 100,
|
||||
moveable: true,
|
||||
resizeable: true,
|
||||
fullScreen: false,
|
||||
popupWindow: false,
|
||||
minimized: false,
|
||||
desktops: [1],
|
||||
|
||||
Reference in New Issue
Block a user