diff --git a/docs/faq.md b/docs/faq.md index a3ad370..a09acc9 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -4,9 +4,16 @@ Follow the instructions [here](usage.html#getting-a-log). +### Why isn't from Bismuth/Sway/other WM in Polonium? + +Other window managers, including Bismuth, have a much finer degree of control over how tiles are managed. Polonium works with the KWin tiling API instead of against it, which both simplifies +it and makes it less configurable. This is a delibrate design choice made to make Polonium feel more integrated with Plasma. + +If you are looking for a more configurable tiling approach, I suggest [Hyprland](https://hyprland.org). + ### How do I move windows with my mouse? -You can drag windows using, by default, `Meta+LMB`. Dragging windows will untile them. Holding `Shift` will allow you to place windows into tiles. Note that you cannot move windows into the root tile by using the mouse. +You can drag windows using, by default, `Meta+LMB`. Dragging windows will untile them. Holding `Shift` will allow you to place windows into tiles. Note that you cannot move windows into the root tile by using the mouse. You can also "quick tile" windows by dragging them into borders of screens, which will place them into the root tile if it is the only tile available. ### How do I move windows with my keyboard / shortcuts not working? @@ -14,7 +21,7 @@ Make sure the shortcuts are set under the KWin tab of the Shortcuts setting. Aft ### This works on Wayland but not X11 -X11 is not officially supported, but you can drop an issue and I can see if I can fix it. Include a log! If I personally don't encounter the error, there is a good chance it will not be fixed. +Plasma 6 has moved to Wayland by default. Support will not be provided for X11. ### Windows appear in strange places but go back to normal after I switch desktops/rebuild the layout diff --git a/docs/usage.md b/docs/usage.md index 461dbbc..5ad73bf 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -8,9 +8,23 @@ Do one of the following - - Go to the [KWin Store](https://store.kde.org/p/2140417) and download the latest `polonium.kwinscript`, then install it in KWin Scripts - Go to KWin Scripts settings panel and Get New Scripts, then search for and select Polonium -It is recommended to install dbus-saver if you have a complex layout. To do this, follow the instructions [on the repo](https://github.com/zeroxoneafour/dbus-saver). +### Extras -## Uninstallation +Unlike Bismuth, Polonium is just a KWin Script and is not a comprehensive set of packages capable of emulating a window manager. Here are some packages and config settings I suggest for a more fluid feel. + +Config settings - + +* Window activation - Focus follows mouse (mouse precedence) +* Delay focus - 0ms +* Window actions modifier key - Meta + +Additional (completely optional) components - + +* [dbus-saver](https://github.com/zeroxoneafour/dbus-saver) - A systemd service for saving settings after logging out. **Officially supported.** +* [Active accent borders](https://github.com/nclarius/Plasma-window-decorations) - Bismuth-like borders for tiled windows. [KDE store](https://store.kde.org/p/1678088) and [AUR](https://aur.archlinux.org/packages/plasma-active-accent-decorations) packages available. **NOT officially supported.** +* [Geometry Change](https://github.com/peterfajdiga/kwin4_effect_geometry_change) - Fluid tiling animations. Available on the [KDE store](https://store.kde.org/p/2136283). + +### Uninstallation To uninstall Polonium, simply uninstall it through KWin Scripts. If you want to remove old shortcuts, edit `~/.config/kglobalshortcutsrc` and remove all mentions of Polonium. To uninstall dbus-saver, do `cargo uninstall dbus-saver` and remove the systemd service. @@ -23,7 +37,7 @@ Windows will be automatically tiled unless the whitelist option is enabled. Wind ### Removing windows -Windows will be removed from the tiling manager automatically as well +Windows will be removed from the tiling manager automatically as well. Windows can be added or removed manually with the Retile Window shortcut (default `Meta+Shift+Space`). ### Resizing tiled windows with your keyboard @@ -31,7 +45,7 @@ The default keybinds to resize tiled windows with your keyboard are `Meta+Ctrl+< ### Resizing tiled windows with your mouse -By pressing the KWin tiles key (default - `Meta+T`) a tile configuration menu will appear. Adding or removing tiles will not have a lasting effect, but resizing tiles will for engines that support it. The clients of these tiles will be automatically resized as well. +By pressing the KWin tiles key (default - `Meta+T`) a tile configuration menu will appear. Adding or removing tiles will not have a lasting effect, but resizing tiles will for engines that support it. The clients of these tiles will be automatically resized as well. In this menu, you can also adjust gaps and padding by editing the setting in the top right corner. ### Moving windows with your keyboard diff --git a/src/controller/actions/windowhooks.ts b/src/controller/actions/windowhooks.ts index a1731f3..9dca1c6 100644 --- a/src/controller/actions/windowhooks.ts +++ b/src/controller/actions/windowhooks.ts @@ -232,28 +232,25 @@ export class WindowHooks { } maximizedChanged(mode: MaximizeMode) { + const maximized = mode == MaximizeMode.MaximizeFull; + this.extensions.maximized = maximized; // ignore if the driver is making windows maximized if (this.ctrl.driverManager.buildingLayout) { return; } - // dont interfere with single maximized windows + // just dont handle maximizing for these if (this.extensions.isSingleMaximized) { return; } - let maximized = mode == MaximizeMode.MaximizeFull; this.logger.debug( "Maximized on window", this.window.resourceClass, "set to", maximized, ); - // root tile applies with "maximize single windows" and should be completely discarded - /* - if (this.ctrl.workspace.tilingForScreen(this.window.output).rootTile == this.window.tile) { - return; - } - */ - if (maximized && this.extensions.isTiled) { + if ( + (maximized && this.extensions.isTiled) + ) { this.ctrl.driverManager.untileWindow(this.window); this.ctrl.driverManager.rebuildLayout(this.window.output); this.extensions.wasTiled = true; diff --git a/src/driver/index.ts b/src/driver/index.ts index b59e7de..18a75dd 100644 --- a/src/driver/index.ts +++ b/src/driver/index.ts @@ -172,7 +172,9 @@ export class DriverManager { } private applyUntiled(window: Window): void { - this.ctrl.windowExtensions.get(window)!.isTiled = false; + const extensions = this.ctrl.windowExtensions.get(window)!; + extensions.isTiled = false; + extensions.isSingleMaximized = false; if (this.config.keepTiledBelow) { window.keepBelow = false; } @@ -212,13 +214,19 @@ export class DriverManager { ); // make registered "untiled" clients appear untiled for (const window of driver.untiledWindows) { - this.applyUntiled(window); - window.tile = null; // sometimes effects on untiled windows dont properly apply if (window.fullScreen) { window.fullScreen = false; window.fullScreen = true; } + // maxmimized + const extensions = this.ctrl.windowExtensions.get(window)!; + const wasSingleMaximized = extensions.isSingleMaximized; + this.applyUntiled(window); + window.tile = null; + if (wasSingleMaximized) { + window.setMaximize(false, false); + } } } this.buildingLayout = false;