Skip to content

bugfix: forward scroll to a pinned window drawn over a stand-in window - #333

Open
Granitosaurus wants to merge 1 commit into
malbiruk:mainfrom
Granitosaurus:fix-pinned-scroll-over-standin
Open

Granitosaurus wants to merge 1 commit into
malbiruk:mainfrom
Granitosaurus:fix-pinned-scroll-over-standin

Conversation

@Granitosaurus

@Granitosaurus Granitosaurus commented Nov 7, 2026 •

Copy link
Copy Markdown

Hello!

First, really dig the project. I spent couple evenings setting everything up and onboarding myself for contributing.

I'm working on a bigger scratchpad/pin feature in #334 where I identified this bug so as per contribution instructions I'm keeping PRs tiny and focused by cherry-picking this bug fix.

Below is mix of my writing and claude generated report. I've tested this on my machine and the fix does work and I hadn't noticed any regressions


Problem

Scrolling over a screen-pinned window does nothing when a suspended stand-in
(the placeholder left after a restart or a suspend) sits on the canvas
underneath it.

Repro:

  1. Restart driftwm so placeholders are restored, and focus one.
  2. Open a pinned window over it (e.g. a pinned_to_screen window, a toggle-scratchpad window, or the pavucontrol popup).
  3. Scroll over the pinned window: nothing happens.

I made a little video to illustrate this:

2026-11-07_14-10-41.mp4

Here if placeholders are in focus the scroll wheel is being stolen and scrolling doesn't work while scrollbar works on scratchpad window. Where if I select active window in 2nd part of the window the scroll works as expected.

Cause

At the end of on_pointer_axis, an unbound scroll is swallowed when decoration_under(pos) finds a stand-in, since a stand-in has no client to forward to. That hit test is canvas-space, so it finds the stand-in beneath the pinned window and drops the scroll before it reaches the pin. Pinned windows are drawn and hit-tested in screen space, so the canvas test cannot see them.

Fix

Skip the swallow when the pointer is over a screen-space target (!self.pointer_over_screen_space), the flag focus_cascade already sets when a pinned window or layer is hit. One condition, plus a comment explaining why.

Scroll bindings (e.g. mod+wheel) are unaffected, as they run before the swallow.

Tests

src/tests/pinned_scroll.rs: a pinned window over a stand-in, a trackpad scroll, and a check that the client received an axis event. It fails without the fix and passes with it.

cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test -- --include-ignored --skip soak pass locally.

An unbound scroll over a suspended stand-in is swallowed because there is
no client to forward it to. The check is a canvas-space hit test, so a
screen-pinned window drawn over the stand-in was invisible to it: the
scroll was dropped instead of reaching the pinned window. Skip the swallow
when the pointer is over a screen-space target.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Granitosaurus
Granitosaurus marked this pull request as ready for review November 7, 2026 07:28
@Granitosaurus Granitosaurus changed the title Forward scroll to a pinned window drawn over a stand-in window bugfix: forward scroll to a pinned window drawn over a stand-in window Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant