From 94bd4123c6e8fd3162e245b0d568c9d6dfd75780 Mon Sep 17 00:00:00 2001 From: ItsOhen Date: Sun, 15 Mar 2026 20:32:05 +0100 Subject: desktop/rules: fix static rules and content type. (#13725) Hopefully for the last time in a while. Also a lot easier to add in new static types with the recheck done in window map instead of the rule. --- hyprtester/src/tests/main/window.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'hyprtester/src/tests/main/window.cpp') diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp index a42ffd38..5c0fe2fe 100644 --- a/hyprtester/src/tests/main/window.cpp +++ b/hyprtester/src/tests/main/window.cpp @@ -647,31 +647,36 @@ static bool testWindowRuleWorkspaceEmpty() { return true; } -static void testContentRules() { +static bool testContentRules() { NLog::log("{}Testing content window rules", Colors::YELLOW); // kill me PLEASE - OK(getFromSocket("/keyword windowrule match:class kitty_bitch, content game")); + OK(getFromSocket("/keyword windowrule match:class kitty_content_string, content game")); + OK(getFromSocket("/keyword windowrule match:class kitty_content_numbers, content 3")); OK(getFromSocket("/keyword windowrule match:content game, border_size 10")); OK(getFromSocket("/keyword windowrule match:content 3, opacity 0.5")); - getFromSocket("/dispatch workspace 420"); + const auto testProps = []() { + EXPECT_CONTAINS(getFromSocket("/getprop active border_size"), "10"); + EXPECT_CONTAINS(getFromSocket("/getprop active opacity"), "0.5"); + }; + if (!spawnKitty("kitty_content_string")) + return false; + waitForActiveWindow("kitty_content_string"); + testProps(); - if (!spawnKitty("kitty_bitch")) { - NLog::log("{}Error: failed to spawn kitty", Colors::RED); - return; - } + Tests::killAllWindows(); + EXPECT(Tests::windowCount(), 0); - { - auto res = getFromSocket("/getprop active border_size"); - EXPECT_CONTAINS(res, "10"); - } + if (!spawnKitty("kitty_content_numbers")) + return false; + waitForActiveWindow("kitty_content_numbers"); + testProps(); - { - auto res = getFromSocket("/getprop active opacity"); - EXPECT_CONTAINS(res, "0.5"); - } + Tests::killAllWindows(); + EXPECT(Tests::windowCount(), 0); + return true; } static bool test() { -- cgit v1.2.3