Commit Graph

435 Commits

Author SHA1 Message Date
Eon S. Jeon
9548f3bf3f implement layout rotation in Tile layout 2020-07-08 08:17:18 +09:00
Eon S. Jeon
1704740d01 add rotate method to RotateLayoutPart 2020-07-08 08:17:04 +09:00
Eon S. Jeon
0346ae33e1 add "Rotate" shortcut 2020-07-08 08:16:41 +09:00
Eon S. Jeon
c2bf027e13 implement RotateLayoutPart
RotateLayoutPart allows rotating its child LayoutPart (and also supports
layout adjustment).

Note that "rotation" here isn't real degree-based rotation. This is an
intentional decision to preserve stack-growing direction (top-to-bottom,
left-to-right).
2020-07-07 21:41:36 +09:00
Eon S. Jeon
2b377f213d regress: tile layout adjusts both stacks
Resizing one window adjusted windows in both stacks. This was because
all tiles were passed for adjustment to either ones. This was fixed by
passing only tiles that belong to each of the stack.
2020-07-06 00:39:07 +09:00
Eon S. Jeon
1ec3085d66 refactor Tile layout using LayoutParts 2020-07-05 20:54:57 +09:00
Eon S. Jeon
81ed83a7e8 implement LayoutPart stuffs 2020-07-05 20:54:40 +09:00
Eon S. Jeon
de271a72e6 make actualGeometry read-only 2020-07-05 20:54:25 +09:00
Eon S. Jeon
d11741adb4 simplify CascadeLayout.decomposeDirection 2020-07-03 08:13:18 +09:00
Eon S. Jeon
47fa847f7e make Rect mutable and use Readonly<Rect> instead
Although readonly is quite a joke in Typescript, this is a better
approach which allows both mutable and immutable patterns.
2020-07-02 06:52:01 +09:00
Eon S. Jeon
2d5e981171 fix Rect signature 2020-07-01 22:06:58 +09:00
Eon S. Jeon
c878120074 bump version to 0.8 2020-06-01 00:35:08 +09:00
Eon S. Jeon
b9d3b2fe0a option: put new window as master (#83) 2020-06-01 00:26:55 +09:00
Eon S. Jeon
ad25afb88f moving floating windows w/ shortcut (#41)
Allow moving floating windows with swap shortcuts.
2020-05-11 09:29:13 +09:00
Eon S. Jeon
f7e047c421 resizing floating windows w/ shortcut (#41)
Allow resizing floating windows with resize shortcuts.
2020-05-11 09:28:51 +09:00
Eon S. Jeon
a4488a836f names and doc for shortcut-related window actions 2020-05-09 19:08:19 +09:00
Eon S. Jeon
ea0e0d7f94 proper handle window started in fullscreen (#76)
Krohnkite implements a policy that automatically floats all
non-resizable windows to prevent breaking layouts. However, when a
window is started directly in fullscreen, KWin naturally reports that
the window is not resizable, even when it' resizable in non-fullscreen.
This causes confusion in Krohnkite, and the script wrongfully floats
such windows.

This commit fixes this by delaying the application of the policy as much
as possible. New windows are initially marked "undecided", and the test
will be performed only when it's required.
2020-05-09 16:42:36 +09:00
Eon S. Jeon
b804adc9c8 better names and readability for WindowState
- Use terms that are aligned with the documentation
 - Some comments
 - more readable Window#commit
2020-05-09 16:42:14 +09:00
Eon S. Jeon
70e4204f82 Use separate layouts by default (#71)
The previous default behavior was derived from dwm. It totally make
sense for dwm, because it has "tag" system instead of virtual desktop.
However, most people are more used to virtual desktop system and
consider each desktp as physically independent entity.  Thus, it makes
more sense to turn this on by default.
2020-05-09 11:50:31 +09:00
Eon S. Jeon
18e8b62173 debug print wndow state 2020-04-11 11:34:50 +09:00
Eon S. Jeon
2ba4fb0418 implement Cascade layout (disabled)
This layout is to replace Spread and Stair layout, but is tucked away
for now.
2020-04-11 11:30:32 +09:00
Eon S. Jeon
dab4b89cdc let KWin decide the size of maximized windows
This allows backends to decide what "maximization" actually is. This is
better than directly controlling maximized windows in Engine, because:

 1. This works well with the KWin maximization animation effect.
 2. The logic is simpler and more adaptable.
2020-04-06 20:03:31 +09:00
Eon S. Jeon
70599520a5
Merge pull request #69 from shocklateboy92/update-doc
Add note to maximize sole window option
2020-04-05 18:27:15 +09:00
Eon S. Jeon
4ac5360633 support KWin native maximization (#64)
This feature is implemented by adding a new window state: Maximized.
It's almost like FullScreen, but window geometry should be manually set
by Engine.
2020-04-04 22:23:41 +09:00
Lasath Fernando
1ad861816d Add note to maximize sole window option
It now mentions the relevant breeze option to prevent windows from
being stuck without borders when this is enabled.
2020-04-03 21:17:19 -07:00
Eon S. Jeon
f1b0d1b373 bugfix: fullscreening messes up keepAbove state
Fixed by not touching keepAbove when window is in fullscreen state.
2020-03-21 16:56:48 +09:00
Eon S. Jeon
7d1d4946a0 store window weights in Window, not in layouts.
Do not keep weight map in layout side, because they grow infinitely for
there's no way to shrink them back.
2020-03-08 18:14:09 +09:00
Eon S. Jeon
2b7909f7f1 fix TCL adjustment
1. master-stack ratio when 2-column
 2. L-stack adjustment size
2020-03-08 18:14:09 +09:00
Eon S. Jeon
1afbc08950 refactor Tile layout to use LayoutUtils 2020-03-08 18:14:09 +09:00
Eon S. Jeon
0d52097630
Merge pull request #62 from shocklateboy92/master
Minor improvement to README
2020-03-07 13:33:00 +09:00
Lasath Fernando
b50beb65ba Minor improvement to README
Adds a nice `kwriteconfig5` commands that can be easily pasted into
a shell to adjust the breeze border colors.
2020-03-02 23:27:34 -08:00
Eon S. Jeon
2ea7feeb2f bugfix: cycling layout breaks layout shortcut 2020-03-01 19:20:34 +09:00
Eon S. Jeon
924f759d41 overhaul config UI
* use groupbox instead of labels to split sections
 * improve sentences
 * item reorganization
 * etc...
2020-03-01 18:48:48 +09:00
Eon S. Jeon
bba40f37bf implement tile width limit 2020-03-01 18:48:39 +09:00
Eon S. Jeon
ed1eab73dd toggle Monocle layout 2020-02-28 21:38:04 +09:00
Eon S. Jeon
2170037dc0 allow resizing south/east-most windows 2020-02-28 12:50:11 +09:00
Eon S. Jeon
829ba91c92 make TCL w/ multiple masters adjustable 2020-02-28 12:41:49 +09:00
Eon S. Jeon
cf8b2ed161 implement diretional swap 2020-02-28 12:06:40 +09:00
Eon S. Jeon
651a15b827 split Engine#getNeighborByDirection 2020-02-28 10:26:59 +09:00
Eon S. Jeon
1ed395c665 changing focus w/ no current window focuses master 2020-02-13 07:38:12 +09:00
Eon S. Jeon
30e1532355 remove Increase/Decrease (2) shortcuts
There were left-over from full-free Column layout. It sucks...
2020-02-13 07:38:12 +09:00
Eon S. Jeon
8ce8c028cf add Next/Previous Layout shortcuts
This also deprecates Cycle Layout shortcut, leaving it unbound by
default.
2020-02-13 07:38:12 +09:00
Eon S. Jeon
f70d18e799 implement well-typed linear layout management
The previous method relied on `any` type and `instanceof`, but the new
method relies on string-based mappings, providing better safety and
clearness.

Also, `CONFIG` now maintains a list of layouts, instead of boolean
values (`enable*Layout`). This will allow implementing extra features
like configurable default layout, configurable layout initial states,
etc.
2020-02-13 07:38:12 +09:00
Eon S. Jeon
37e44bbb93 purge the concept of "enable layout" 2020-02-13 07:38:12 +09:00
Eon S. Jeon
92a52eefee bump version to 0.7 2020-02-13 07:38:12 +09:00
Eon S. Jeon
f811a1e9d0 improve noBorder state management (#59)
The previous implementation simply took the initial noBorder value, and
enforce it throughout the lifetime of a window. The new implementation,
instead, respects changes made to noBorder.

This is achieved by introducing "noBorder managed mode" to distinguish
user- or app-induced changes from changes made by Krohnkite itself.
2020-02-12 22:14:55 +09:00
Eon S. Jeon
5c734e67b1 bump version to 0.6.1 2020-02-09 02:09:21 +09:00
Eon S. Jeon
88a8f95cd7 bugfix: set keep-above to new floating windows 2020-02-07 18:30:13 +09:00
Eon S. Jeon
084e5597aa suppress harmless error (#57)
Older `tsc` complains about variable initialization inside *exhaustive*
switch statement.

This is worked around by making one `case` passthru to `default`.
2020-02-01 23:05:08 +09:00
Eon S. Jeon
e690f4e493 improve TCL master ratio semantic
Given the master ratio, `r`, stack ratio, `q`, used to be:

        q = (1 - r) / 2

This caused squeezed windows when the layout mode changed from single
stack to double stack.

To make the transition more smooth, q is now:

        q = 1 - r

... and, since `p + 2*q > 1`, weights are normalized during computation.

The algorithm becomes opaque, but it works anyway.
2020-02-01 17:06:19 +09:00