Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

Follow-ups for PR #16: i18n template, scroll helper, editor hover test

oxydizer901233a2f133
diff --git a/po/rediwm.pot b/po/rediwm.pot
index 4a216df..f53a722 100644
--- a/po/rediwm.pot
+++ b/po/rediwm.pot
@@ -3087,6 +3087,10 @@ msgstr ""
msgid "Interactive authorization required."
msgstr ""
+#: src/control_center/sections/appearance_rows.zig
+msgid "Interactive surface glow"
+msgstr ""
+
#: src/control_center/welcome.zig
msgid "Interface scale"
msgstr ""
@@ -3323,6 +3327,10 @@ msgstr ""
msgid "Lid closed with external display"
msgstr ""
+#: src/control_center/sections/appearance_rows.zig
+msgid "Light interactive control edges near the pointer"
+msgstr ""
+
#: src/control_center/sections/appearance_rows.zig
msgid "Light the active window's edge near the pointer"
msgstr ""
diff --git a/tests/editor_visuals.py b/tests/editor_visuals.py
index 97e7a1f..145587d 100644
--- a/tests/editor_visuals.py
+++ b/tests/editor_visuals.py
@@ -138,9 +138,12 @@ def run():
return shot.crop(tuple(round(v*factor) for v in (
box['x']+140, box['y']+header+2,
box['x']+174, box['y']+header+36)))
- idle_close=hover_image(130, header+19)
+ # The pointer glow lights controls within border_glow_reach (56 px)
+ # of the pointer, so the resting image is taken well outside it.
+ idle_close=hover_image(300, header+200)
+ near_close=hover_image(130, header+19)
hover_close=hover_image(145, header+19)
- assert ImageChops.difference(idle_close, hover_close).getbbox(), 'close-tab hover did not repaint'
+ assert ImageChops.difference(near_close, hover_close).getbbox(), 'close-tab hover did not repaint'
left_close=hover_image(-30, -30)
assert not ImageChops.difference(idle_close, left_close).getbbox(), 'close-tab hover stuck after pointer leave'
print('close-tab hover appears and clears on pointer leave',flush=True)
diff --git a/tests/ui_driver.py b/tests/ui_driver.py
index bf2b026..348006b 100644
--- a/tests/ui_driver.py
+++ b/tests/ui_driver.py
@@ -24,9 +24,13 @@ class UIDriver:
"""Scroll the panel's content until the widget named `name` is fully
visible, and return it with its new box."""
# The wheel direction depends on scroll settings, so learn it: flip
- # whenever a step moves the widget away from the viewport.
+ # whenever a step moves the widget away from the viewport. A step that
+ # carries the widget across the viewport top is too coarse for a tall
+ # widget (the visible window is only viewport minus widget height), so
+ # halve it instead; otherwise the loop bounces over the window forever.
step = -130
last_distance = None
+ last_below = None
for _ in range(attempts):
tree = self.widgets(panel)
widget = next(w for w in tree if w["name"] == name)
@@ -35,9 +39,13 @@ class UIDriver:
viewport = next(w for w in tree if w["role"] == "scroll_container")
below = widget["box"]["y"] > viewport["box"]["y"]
distance = abs(widget["box"]["y"] - viewport["box"]["y"])
- if last_distance is not None and distance >= last_distance:
- step = -step
+ if last_distance is not None:
+ if below != last_below:
+ step = (1 if step > 0 else -1) * max(10, abs(step) // 2)
+ elif distance >= last_distance:
+ step = -step
last_distance = distance
+ last_below = below
area = viewport["global_box"]
# The viewport centre may be over a nested scroll container
# (Appearance's wallpaper strip). Its trailing gutter belongs