diff options
| author | ItsOhen <TNordfeldt@gmail.com> | 2026-03-17 17:43:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-17 12:43:53 -0400 |
| commit | 9f599e316504943eec5d2fa854f7c99c575616b7 (patch) | |
| tree | 58041f7feb19ca8e022ae3639524b7c51ef05427 /hyprtester | |
| parent | 35ef8dc1f7abb3e7139de5f8831ca2b0d81da78c (diff) | |
window/rules: add scrolling_width (#13754)
Diffstat (limited to 'hyprtester')
| -rw-r--r-- | hyprtester/src/tests/main/scroll.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hyprtester/src/tests/main/scroll.cpp b/hyprtester/src/tests/main/scroll.cpp index 8bb950dd..3662f965 100644 --- a/hyprtester/src/tests/main/scroll.cpp +++ b/hyprtester/src/tests/main/scroll.cpp @@ -198,6 +198,34 @@ static void testSwapcolWrapping() { Tests::killAllWindows(); } +static bool testWindowRule() { + NLog::log("{}Testing Scrolling Width", Colors::GREEN); + + // inject a new rule. + OK(getFromSocket("/keyword windowrule[scrolling-width]:match:class kitty_scroll")); + OK(getFromSocket("/keyword windowrule[scrolling-width]:scrolling_width 0.1")); + + if (!Tests::spawnKitty("kitty_scroll")) { + NLog::log("{}Failed to spawn kitty with win class `kitty_scroll`", Colors::RED); + return false; + } + + if (!Tests::spawnKitty("kitty_scroll")) { + NLog::log("{}Failed to spawn kitty with win class `kitty_scroll`", Colors::RED); + return false; + } + + EXPECT(Tests::windowCount(), 2); + + // not the greatest test, but as long as res and gaps don't change, we good. + EXPECT_CONTAINS(getFromSocket("/activewindow"), "size: 174,1036"); + + NLog::log("{}Killing all windows", Colors::YELLOW); + Tests::killAllWindows(); + EXPECT(Tests::windowCount(), 0); + return true; +} + static bool test() { NLog::log("{}Testing Scroll layout", Colors::GREEN); @@ -217,6 +245,8 @@ static bool test() { NLog::log("{}Testing swapcol wrap", Colors::GREEN); testSwapcolWrapping(); + testWindowRule(); + // clean up NLog::log("Cleaning up", Colors::YELLOW); OK(getFromSocket("/dispatch workspace 1")); |
