From 9f599e316504943eec5d2fa854f7c99c575616b7 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Tue, 17 Mar 2026 17:43:53 +0100 Subject: window/rules: add scrolling_width (#13754) --- hyprtester/src/tests/main/scroll.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'hyprtester/src/tests/main/scroll.cpp') 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")); -- cgit v1.2.3