Skip to content

Commit c2670e9

Browse files
vaxerskifufexan
andauthored
windowrules: rewrite completely (#12269)
Reworks the window rule syntax completely --------- Co-authored-by: Mihai Fufezan <[email protected]>
1 parent 95ee08b commit c2670e9

File tree

93 files changed

+3577
-2258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3577
-2258
lines changed

.github/actions/setup_base/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ runs:
4545
libxkbfile \
4646
lld \
4747
meson \
48+
muparser \
4849
ninja \
4950
pango \
5051
pixman \

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ pkg_check_modules(
233233
libinput>=1.28
234234
gbm
235235
gio-2.0
236-
re2)
236+
re2
237+
muparser)
237238

238239
find_package(hyprwayland-scanner 0.3.10 REQUIRED)
239240

example/hyprland.conf

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,23 @@ animations {
159159
# uncomment all if you wish to use that.
160160
# workspace = w[tv1], gapsout:0, gapsin:0
161161
# workspace = f[1], gapsout:0, gapsin:0
162-
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
163-
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
164-
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
165-
# windowrule = rounding 0, floating:0, onworkspace:f[1]
162+
# windowrule {
163+
# name = smart-gaps-1
164+
# floating = false
165+
# on_workspace = n[s:window] w[tv1]
166+
#
167+
# border_size = 0
168+
# rounding = 0
169+
# }
170+
#
171+
# windowrule {
172+
# name = smart-gaps-2
173+
# floating = false
174+
# on_workspace = n[s:window] f[1]
175+
#
176+
# border_size = 0
177+
# rounding = 0
178+
# }
166179

167180
# See https://wiki.hypr.land/Configuring/Dwindle-Layout/ for more
168181
dwindle {
@@ -294,11 +307,25 @@ bindl = , XF86AudioPrev, exec, playerctl previous
294307
# See https://wiki.hypr.land/Configuring/Window-Rules/ for more
295308
# See https://wiki.hypr.land/Configuring/Workspace-Rules/ for workspace rules
296309

297-
# Example windowrule
298-
# windowrule = float,class:^(kitty)$,title:^(kitty)$
310+
# Example windowrules that are useful
299311

300-
# Ignore maximize requests from apps. You'll probably like this.
301-
windowrule = suppressevent maximize, class:.*
312+
windowrule {
313+
# Ignore maximize requests from all apps. You'll probably like this.
314+
name = suppress-maximize-events
315+
match:class = .*
302316

303-
# Fix some dragging issues with XWayland
304-
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
317+
suppress_event = maximize
318+
}
319+
320+
windowrule {
321+
# Fix some dragging issues with XWayland
322+
match:name = fix-xwayland-drags
323+
match:class = ^$
324+
match:title = ^$
325+
match:xwayland = true
326+
match:float = true
327+
match:fullscreen = false
328+
match:pin = false
329+
330+
no_focus = true
331+
}

hyprtester/plugin/src/main.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <src/managers/input/InputManager.hpp>
1212
#include <src/managers/PointerManager.hpp>
1313
#include <src/managers/input/trackpad/TrackpadGestures.hpp>
14+
#include <src/desktop/rule/windowRule/WindowRuleEffectContainer.hpp>
15+
#include <src/desktop/rule/windowRule/WindowRuleApplicator.hpp>
1416
#include <src/Compositor.hpp>
1517
#undef private
1618

@@ -245,6 +247,30 @@ static SDispatchResult keybind(std::string in) {
245247
return {};
246248
}
247249

250+
static Desktop::Rule::CWindowRuleEffectContainer::storageType ruleIDX = 0;
251+
252+
//
253+
static SDispatchResult addRule(std::string in) {
254+
ruleIDX = Desktop::Rule::windowEffects()->registerEffect("plugin_rule");
255+
256+
if (Desktop::Rule::windowEffects()->registerEffect("plugin_rule") != ruleIDX)
257+
return {.success = false, .error = "re-registering returned a different id?"};
258+
return {};
259+
}
260+
261+
static SDispatchResult checkRule(std::string in) {
262+
if (!g_pCompositor->m_lastWindow)
263+
return {.success = false, .error = "No window"};
264+
265+
if (!g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props.contains(ruleIDX))
266+
return {.success = false, .error = "No rule"};
267+
268+
if (g_pCompositor->m_lastWindow->m_ruleApplicator->m_otherProps.props[ruleIDX]->effect != "effect")
269+
return {.success = false, .error = "Effect isn't \"effect\""};
270+
271+
return {};
272+
}
273+
248274
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
249275
PHANDLE = handle;
250276

@@ -255,6 +281,8 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
255281
HyprlandAPI::addDispatcherV2(PHANDLE, "plugin:test:gesture", ::simulateGesture);
256282
HyprlandAPI::addDispatcherV2(PHANDLE, "plugin:test:scroll", ::scroll);
257283
HyprlandAPI::addDispatcherV2(PHANDLE, "plugin:test:keybind", ::keybind);
284+
HyprlandAPI::addDispatcherV2(PHANDLE, "plugin:test:add_rule", ::addRule);
285+
HyprlandAPI::addDispatcherV2(PHANDLE, "plugin:test:check_rule", ::checkRule);
258286

259287
// init mouse
260288
g_mouse = CTestMouse::create(false);

hyprtester/src/tests/clients/pointer-scroll.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static bool startClient(SClient& client) {
6464
// wait for window to appear
6565
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
6666

67-
if (getFromSocket(std::format("/dispatch setprop pid:{} noanim 1", client.proc->pid())) != "ok") {
67+
if (getFromSocket(std::format("/dispatch setprop pid:{} no_anim 1", client.proc->pid())) != "ok") {
6868
NLog::log("{}Failed to disable animations for client window", Colors::RED, ret);
6969
return false;
7070
}
@@ -130,7 +130,7 @@ static bool test() {
130130
EXPECT(sendScroll(10), true);
131131
EXPECT(getLastDelta(client), 30);
132132

133-
EXPECT(getFromSocket("r/dispatch setprop active scrollmouse 4"), "ok");
133+
EXPECT(getFromSocket("r/dispatch setprop active scroll_mouse 4"), "ok");
134134
EXPECT(sendScroll(10), true);
135135
EXPECT(getLastDelta(client), 40);
136136

hyprtester/src/tests/clients/pointer-warp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static bool startClient(SClient& client) {
6464
// wait for window to appear
6565
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
6666

67-
if (getFromSocket(std::format("/dispatch setprop pid:{} noanim 1", client.proc->pid())) != "ok") {
67+
if (getFromSocket(std::format("/dispatch setprop pid:{} no_anim 1", client.proc->pid())) != "ok") {
6868
NLog::log("{}Failed to disable animations for client window", Colors::RED, ret);
6969
return false;
7070
}

hyprtester/src/tests/main/hyprctl.cpp

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -56,82 +56,82 @@ static bool testGetprop() {
5656
return false;
5757
}
5858

59-
// animationstyle
60-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animationstyle"), "(unset)");
61-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animationstyle -j"), R"({"animationstyle": ""})");
62-
getFromSocket("/dispatch setprop class:kitty animationstyle teststyle");
63-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animationstyle"), "teststyle");
64-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animationstyle -j"), R"({"animationstyle": "teststyle"})");
65-
66-
// maxsize
67-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty maxsize"), "inf inf");
68-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty maxsize -j"), R"({"maxsize": [null,null]})");
69-
getFromSocket("/dispatch setprop class:kitty maxsize 200 150");
70-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty maxsize"), "200 150");
71-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty maxsize -j"), R"({"maxsize": [200,150]})");
72-
73-
// minsize
74-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty minsize"), "20 20");
75-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty minsize -j"), R"({"minsize": [20,20]})");
76-
getFromSocket("/dispatch setprop class:kitty minsize 100 50");
77-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty minsize"), "100 50");
78-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty minsize -j"), R"({"minsize": [100,50]})");
79-
80-
// alpha
81-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alpha"), "1");
82-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alpha -j"), R"({"alpha": 1})");
83-
getFromSocket("/dispatch setprop class:kitty alpha 0.3");
84-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alpha"), "0.3");
85-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alpha -j"), R"({"alpha": 0.3})");
86-
87-
// alphainactive
88-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactive"), "1");
89-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactive -j"), R"({"alphainactive": 1})");
90-
getFromSocket("/dispatch setprop class:kitty alphainactive 0.5");
91-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactive"), "0.5");
92-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactive -j"), R"({"alphainactive": 0.5})");
93-
94-
// alphafullscreen
95-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreen"), "1");
96-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreen -j"), R"({"alphafullscreen": 1})");
97-
getFromSocket("/dispatch setprop class:kitty alphafullscreen 0.75");
98-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreen"), "0.75");
99-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreen -j"), R"({"alphafullscreen": 0.75})");
100-
101-
// alphaoverride
102-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphaoverride"), "false");
103-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphaoverride -j"), R"({"alphaoverride": false})");
104-
getFromSocket("/dispatch setprop class:kitty alphaoverride true");
105-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphaoverride"), "true");
106-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphaoverride -j"), R"({"alphaoverride": true})");
107-
108-
// alphainactiveoverride
109-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactiveoverride"), "false");
110-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactiveoverride -j"), R"({"alphainactiveoverride": false})");
111-
getFromSocket("/dispatch setprop class:kitty alphainactiveoverride true");
112-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactiveoverride"), "true");
113-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphainactiveoverride -j"), R"({"alphainactiveoverride": true})");
114-
115-
// alphafullscreenoverride
116-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreenoverride"), "false");
117-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreenoverride -j"), R"({"alphafullscreenoverride": false})");
118-
getFromSocket("/dispatch setprop class:kitty alphafullscreenoverride true");
119-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreenoverride"), "true");
120-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty alphafullscreenoverride -j"), R"({"alphafullscreenoverride": true})");
121-
122-
// activebordercolor
123-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty activebordercolor"), "ee33ccff ee00ff99 45deg");
124-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty activebordercolor -j"), R"({"activebordercolor": "ee33ccff ee00ff99 45deg"})");
125-
getFromSocket("/dispatch setprop class:kitty activebordercolor rgb(abcdef)");
126-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty activebordercolor"), "ffabcdef 0deg");
127-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty activebordercolor -j"), R"({"activebordercolor": "ffabcdef 0deg"})");
59+
// animation
60+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animation"), "(unset)");
61+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animation -j"), R"({"animation": ""})");
62+
getFromSocket("/dispatch setprop class:kitty animation teststyle");
63+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animation"), "teststyle");
64+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty animation -j"), R"({"animation": "teststyle"})");
65+
66+
// max_size
67+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty max_size"), "inf inf");
68+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty max_size -j"), R"({"max_size": [null,null]})");
69+
getFromSocket("/dispatch setprop class:kitty max_size 200 150");
70+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty max_size"), "200 150");
71+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty max_size -j"), R"({"max_size": [200,150]})");
72+
73+
// min_size
74+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty min_size"), "20 20");
75+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty min_size -j"), R"({"min_size": [20,20]})");
76+
getFromSocket("/dispatch setprop class:kitty min_size 100 50");
77+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty min_size"), "100 50");
78+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty min_size -j"), R"({"min_size": [100,50]})");
79+
80+
// opacity
81+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity"), "1");
82+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity -j"), R"({"opacity": 1})");
83+
getFromSocket("/dispatch setprop class:kitty opacity 0.3");
84+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity"), "0.3");
85+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity -j"), R"({"opacity": 0.3})");
86+
87+
// opacity_inactive
88+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive"), "1");
89+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive -j"), R"({"opacity_inactive": 1})");
90+
getFromSocket("/dispatch setprop class:kitty opacity_inactive 0.5");
91+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive"), "0.5");
92+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive -j"), R"({"opacity_inactive": 0.5})");
93+
94+
// opacity_fullscreen
95+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen"), "1");
96+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen -j"), R"({"opacity_fullscreen": 1})");
97+
getFromSocket("/dispatch setprop class:kitty opacity_fullscreen 0.75");
98+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen"), "0.75");
99+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen -j"), R"({"opacity_fullscreen": 0.75})");
100+
101+
// opacity_override
102+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_override"), "false");
103+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_override -j"), R"({"opacity_override": false})");
104+
getFromSocket("/dispatch setprop class:kitty opacity_override true");
105+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_override"), "true");
106+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_override -j"), R"({"opacity_override": true})");
107+
108+
// opacity_inactive_override
109+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive_override"), "false");
110+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive_override -j"), R"({"opacity_inactive_override": false})");
111+
getFromSocket("/dispatch setprop class:kitty opacity_inactive_override true");
112+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive_override"), "true");
113+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_inactive_override -j"), R"({"opacity_inactive_override": true})");
114+
115+
// opacity_fullscreen_override
116+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen_override"), "false");
117+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen_override -j"), R"({"opacity_fullscreen_override": false})");
118+
getFromSocket("/dispatch setprop class:kitty opacity_fullscreen_override true");
119+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen_override"), "true");
120+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty opacity_fullscreen_override -j"), R"({"opacity_fullscreen_override": true})");
121+
122+
// active_border_color
123+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty active_border_color"), "ee33ccff ee00ff99 45deg");
124+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty active_border_color -j"), R"({"active_border_color": "ee33ccff ee00ff99 45deg"})");
125+
getFromSocket("/dispatch setprop class:kitty active_border_color rgb(abcdef)");
126+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty active_border_color"), "ffabcdef 0deg");
127+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty active_border_color -j"), R"({"active_border_color": "ffabcdef 0deg"})");
128128

129129
// bool window properties
130-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allowsinput"), "false");
131-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allowsinput -j"), R"({"allowsinput": false})");
132-
getFromSocket("/dispatch setprop class:kitty allowsinput true");
133-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allowsinput"), "true");
134-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allowsinput -j"), R"({"allowsinput": true})");
130+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allows_input"), "false");
131+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allows_input -j"), R"({"allows_input": false})");
132+
getFromSocket("/dispatch setprop class:kitty allows_input true");
133+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allows_input"), "true");
134+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty allows_input -j"), R"({"allows_input": true})");
135135

136136
// int window properties
137137
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding"), "10");
@@ -141,16 +141,16 @@ static bool testGetprop() {
141141
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding -j"), R"({"rounding": 4})");
142142

143143
// float window properties
144-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty roundingpower"), "2");
145-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty roundingpower -j"), R"({"roundingpower": 2})");
146-
getFromSocket("/dispatch setprop class:kitty roundingpower 1.25");
147-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty roundingpower"), "1.25");
148-
EXPECT(getCommandStdOut("hyprctl getprop class:kitty roundingpower -j"), R"({"roundingpower": 1.25})");
144+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding_power"), "2");
145+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding_power -j"), R"({"rounding_power": 2})");
146+
getFromSocket("/dispatch setprop class:kitty rounding_power 1.25");
147+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding_power"), "1.25");
148+
EXPECT(getCommandStdOut("hyprctl getprop class:kitty rounding_power -j"), R"({"rounding_power": 1.25})");
149149

150150
// errors
151151
EXPECT(getCommandStdOut("hyprctl getprop"), "not enough args");
152152
EXPECT(getCommandStdOut("hyprctl getprop class:kitty"), "not enough args");
153-
EXPECT(getCommandStdOut("hyprctl getprop class:nonexistantclass animationstyle"), "window not found");
153+
EXPECT(getCommandStdOut("hyprctl getprop class:nonexistantclass animation"), "window not found");
154154
EXPECT(getCommandStdOut("hyprctl getprop class:kitty nonexistantprop"), "prop not found");
155155

156156
// kill all

hyprtester/src/tests/main/tags.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,24 @@ static bool testTags() {
2121

2222
NLog::log("{}Testing testTag tags", Colors::YELLOW);
2323

24-
OK(getFromSocket("/keyword windowrule tag +testTag, class:tagged"));
25-
OK(getFromSocket("/keyword windowrule noshadow, tag:negative:testTag"));
26-
OK(getFromSocket("/keyword windowrule noborder, tag:testTag"));
24+
OK(getFromSocket("/keyword windowrule[tag-test-1]:tag +testTag"));
25+
OK(getFromSocket("/keyword windowrule[tag-test-1]:match:class tagged"));
26+
OK(getFromSocket("/keyword windowrule[tag-test-2]:match:tag negative:testTag"));
27+
OK(getFromSocket("/keyword windowrule[tag-test-2]:no_shadow true"));
28+
OK(getFromSocket("/keyword windowrule[tag-test-3]:match:tag testTag"));
29+
OK(getFromSocket("/keyword windowrule[tag-test-3]:no_dim true"));
2730

2831
EXPECT(Tests::windowCount(), 2);
2932
OK(getFromSocket("/dispatch focuswindow class:tagged"));
30-
NLog::log("{}Testing tagged window for noborder & noshadow", Colors::YELLOW);
33+
NLog::log("{}Testing tagged window for no_dim 0 & no_shadow", Colors::YELLOW);
3134
EXPECT_CONTAINS(getFromSocket("/activewindow"), "testTag");
32-
EXPECT_CONTAINS(getFromSocket("/getprop activewindow noborder"), "true");
33-
EXPECT_CONTAINS(getFromSocket("/getprop activewindow noshadow"), "false");
34-
NLog::log("{}Testing untagged window for noborder & noshadow", Colors::YELLOW);
35+
EXPECT_CONTAINS(getFromSocket("/getprop activewindow no_dim"), "true");
36+
EXPECT_CONTAINS(getFromSocket("/getprop activewindow no_shadow"), "false");
37+
NLog::log("{}Testing untagged window for no_dim & no_shadow", Colors::YELLOW);
3538
OK(getFromSocket("/dispatch focuswindow class:untagged"));
3639
EXPECT_NOT_CONTAINS(getFromSocket("/activewindow"), "testTag");
37-
EXPECT_CONTAINS(getFromSocket("/getprop activewindow noborder"), "false");
38-
EXPECT_CONTAINS(getFromSocket("/getprop activewindow noshadow"), "true");
40+
EXPECT_CONTAINS(getFromSocket("/getprop activewindow no_shadow"), "true");
41+
EXPECT_CONTAINS(getFromSocket("/getprop activewindow no_dim"), "false");
3942

4043
Tests::killAllWindows();
4144
EXPECT(Tests::windowCount(), 0);

0 commit comments

Comments
 (0)