diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-10-29 23:21:28 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-29 23:21:28 +0000 |
| commit | 6ade4d58cab67e18aa758ef664e36421cab4d8b2 (patch) | |
| tree | bab86dd894b6720136ffaa4dcc0bc4267cd119a7 /hyprtester/src/tests/main/dwindle.cpp | |
| parent | 83a0a62004ee915921ac36a96760944ad6550e1e (diff) | |
layout: fit floating window on toggle to float (#12139)
Diffstat (limited to 'hyprtester/src/tests/main/dwindle.cpp')
| -rw-r--r-- | hyprtester/src/tests/main/dwindle.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/dwindle.cpp b/hyprtester/src/tests/main/dwindle.cpp new file mode 100644 index 00000000..a75646c8 --- /dev/null +++ b/hyprtester/src/tests/main/dwindle.cpp @@ -0,0 +1,53 @@ +#include "../shared.hpp" +#include "../../shared.hpp" +#include "../../hyprctlCompat.hpp" +#include "tests.hpp" + +static int ret = 0; + +static void testFloatClamp() { + for (auto const& win : {"a", "b", "c"}) { + if (!Tests::spawnKitty(win)) { + NLog::log("{}Failed to spawn kitty with win class `{}`", Colors::RED, win); + ++TESTS_FAILED; + ret = 1; + return; + } + } + + OK(getFromSocket("/keyword dwindle:force_split 2")); + OK(getFromSocket("/dispatch focuswindow class:c")); + OK(getFromSocket("/dispatch setfloating class:c")); + OK(getFromSocket("/dispatch resizewindowpixel exact 1200 900,class:c")); + OK(getFromSocket("/dispatch settiled class:c")); + OK(getFromSocket("/dispatch setfloating class:c")); + + { + auto str = getFromSocket("/clients"); + EXPECT_CONTAINS(str, "at: 718,178"); + EXPECT_CONTAINS(str, "size: 1200,900"); + } + + OK(getFromSocket("/keyword dwindle:force_split 0")); + + // clean up + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); +} + +static bool test() { + NLog::log("{}Testing Dwindle layout", Colors::GREEN); + + // test + NLog::log("{}Testing float clamp", Colors::GREEN); + testFloatClamp(); + + // clean up + NLog::log("Cleaning up", Colors::YELLOW); + getFromSocket("/dispatch workspace 1"); + OK(getFromSocket("/reload")); + + return !ret; +} + +REGISTER_TEST_FN(test); |
