mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 05:41:16 +01:00
test(nix): maximizing.user follows what both ports do
The scenario asked the daemon to ignore toggle-float and the stacking commands while a window is maximized, which komorebi for Windows does not. They are out of the ignored list, and the scenario checks that toggle-float floats the maximized window, ends the maximize, and puts it back in the layout the second time. BEHAVIOUR.md says the ports agree.
This commit is contained in:
1 parent
aafc52f42d
commit
b3dc2ed903
4 files changed
+46
-13
No files matched your search
@@ -261,13 +261,12 @@ counts when it needs them and asks only that the monitor it left shows a workspa
|
|||||||
Windows runs on `next` (komorebi `6d862a11`), with the decision of what to do with each:
|
Windows runs on `next` (komorebi `6d862a11`), with the decision of what to do with each:
|
||||||
|
|
||||||
- **A window the user maximizes** (`maximizing.user`, the title bar button). kfde takes it as the
|
- **A window the user maximizes** (`maximizing.user`, the title bar button). kfde takes it as the
|
||||||
workspace's maximized window, as for `toggle-maximize`. kfw's `next` (aa353a71) does too now, and
|
workspace's maximized window, as for `toggle-maximize`, and kfw's `next` (3fa3d429) does too.
|
||||||
the first checks pass. What differs is what the layout commands do while it is maximized: kfde
|
The two ports now agree on what the layout commands do while it is maximized: `move`,
|
||||||
ignores them all, and kfw, with a window the user maximized, still ignores `move`, `cycle-move`,
|
`cycle-move`, `promote`, `unstack`, the resize, send and lock commands and the monocle do
|
||||||
`promote` and `unstack`, but `stack left/right` stacks the other windows (two containers become
|
nothing, `toggle-float` floats the maximized window and ends the maximize, and `stack left` and
|
||||||
one) and `toggle-float` floats the window and ends the maximize. **Which is the reference is a
|
`stack right` stack the tiles that are left. kfde used to ignore the last two as well; it
|
||||||
decision, with the maintainer**; the scenario stays as it is and the Windows runner records the
|
follows kfw (**decided**, and the only difference there was). The scenario asserts what is common.
|
||||||
rest as known failures.
|
|
||||||
- **A window moved to another display by something other than a drag** (`hotplug.user_move`,
|
- **A window moved to another display by something other than a drag** (`hotplug.user_move`,
|
||||||
`SetWindowPos` on Windows). kfde follows the window to the other monitor; kfw relocates a window
|
`SetWindowPos` on Windows). kfde follows the window to the other monitor; kfw relocates a window
|
||||||
only when a drag ends (`MoveResizeEnd`) and a move by any other means raises no such event, so it
|
only when a drag ends (`MoveResizeEnd`) and a move by any other means raises no such event, so it
|
||||||
|
|||||||
@@ -58,18 +58,18 @@ def run(platform: Platform, checks: Checks, clients: list[Client]) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# What is asked of the layout, which a maximized window is not in: none of it does anything.
|
# What is asked of the layout, which a maximized window is not in: none of it does anything. Not in
|
||||||
|
# the list, because komorebi for Windows does not ignore them either: `toggle-float`, which floats
|
||||||
|
# the maximized window (`user` ends with it), and `stack left` and `stack right`, which stack the
|
||||||
|
# tiles that are left.
|
||||||
IGNORED = (
|
IGNORED = (
|
||||||
"move left",
|
"move left",
|
||||||
"move right",
|
"move right",
|
||||||
"move up",
|
"move up",
|
||||||
"move down",
|
"move down",
|
||||||
"stack left",
|
|
||||||
"stack right",
|
|
||||||
"unstack",
|
"unstack",
|
||||||
"cycle-move next",
|
"cycle-move next",
|
||||||
"promote",
|
"promote",
|
||||||
"toggle-float",
|
|
||||||
"toggle-monocle",
|
"toggle-monocle",
|
||||||
"resize-edge left increase",
|
"resize-edge left increase",
|
||||||
"send-to-workspace 1",
|
"send-to-workspace 1",
|
||||||
@@ -165,3 +165,32 @@ def user(platform: Platform, checks: Checks, clients: list[Client]) -> None:
|
|||||||
timeout=20,
|
timeout=20,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# `toggle-float` is asked of the window in front, and that is the maximized one: it floats and
|
||||||
|
# is not maximized any more, as on komorebi for Windows
|
||||||
|
platform.user_maximize(target)
|
||||||
|
platform.wait_for(lambda: maximized() == target.title, timeout=20)
|
||||||
|
platform.komorebic("toggle-float")
|
||||||
|
checks.check(
|
||||||
|
f"toggle-float floats {target.title}, which the user maximized, and ends the maximize",
|
||||||
|
platform.wait_for(
|
||||||
|
lambda: (
|
||||||
|
maximized() is None
|
||||||
|
and [w.title for w in platform.state().workspace().floating] == [target.title]
|
||||||
|
and containers() == count - 1
|
||||||
|
),
|
||||||
|
timeout=20,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
platform.komorebic("toggle-float")
|
||||||
|
checks.check(
|
||||||
|
f"... and again puts {target.title} back in the layout",
|
||||||
|
platform.wait_for(
|
||||||
|
lambda: (
|
||||||
|
containers() == count
|
||||||
|
and platform.state().workspace().floating == []
|
||||||
|
and tiled(platform, clients)
|
||||||
|
),
|
||||||
|
timeout=20,
|
||||||
|
),
|
||||||
|
)
|
||||||
@@ -24,7 +24,6 @@ ASKED_OF_THE_LAYOUT = (
|
|||||||
"unstack",
|
"unstack",
|
||||||
"cycle-move",
|
"cycle-move",
|
||||||
"promote",
|
"promote",
|
||||||
"toggle-float",
|
|
||||||
"toggle-monocle",
|
"toggle-monocle",
|
||||||
"resize-edge",
|
"resize-edge",
|
||||||
"send-to-workspace",
|
"send-to-workspace",
|
||||||
@@ -763,6 +762,12 @@ class FakePlatform:
|
|||||||
self.paused = not self.paused
|
self.paused = not self.paused
|
||||||
case ("toggle-tiling",):
|
case ("toggle-tiling",):
|
||||||
self.tiling = not self.tiling
|
self.tiling = not self.tiling
|
||||||
|
case ("toggle-float",) if self.maximized is not None:
|
||||||
|
# a maximized window is not in the layout: floating it ends the maximize
|
||||||
|
self.floats.append(self.maximized)
|
||||||
|
self.maximized = None
|
||||||
|
self.max_home = None
|
||||||
|
self._relayout()
|
||||||
case ("toggle-float",):
|
case ("toggle-float",):
|
||||||
if self.floats:
|
if self.floats:
|
||||||
self.containers.insert(self.focus, [self.floats.pop()])
|
self.containers.insert(self.focus, [self.floats.pop()])
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ def test_a_daemon_that_takes_up_a_maximize_passes_user_maximize() -> None:
|
|||||||
base = checks.passed
|
base = checks.passed
|
||||||
maximizing.user(platform, checks, clients)
|
maximizing.user(platform, checks, clients)
|
||||||
assert checks.failed == 0, checks.failures
|
assert checks.failed == 0, checks.failures
|
||||||
assert checks.passed - base == 8
|
assert checks.passed - base == 10
|
||||||
|
|
||||||
|
|
||||||
def test_a_daemon_that_obeys_commands_when_maximized_fails_user_maximize() -> None:
|
def test_a_daemon_that_obeys_commands_when_maximized_fails_user_maximize() -> None:
|
||||||
|
|||||||
Reference in new issue
Block a user