Skip to content

fix: invert KDE portal discrete vertical scroll polarity (#56)#57

Open
avifenesh wants to merge 1 commit into
mainfrom
fix/kde-portal-scroll-polarity
Open

fix: invert KDE portal discrete vertical scroll polarity (#56)#57
avifenesh wants to merge 1 commit into
mainfrom
fix/kde-portal-scroll-polarity

Conversation

@avifenesh

Copy link
Copy Markdown
Collaborator

Summary

  • On KDE Plasma Wayland, scroll via the XDG RemoteDesktop portal inverted vertical direction (down scrolled up and vice versa).
  • Root cause (from Scroll direction is inverted on KDE Plasma Wayland #56): xdg-desktop-portal-kde passes discrete axis steps through without the vertical negation applied on its continuous path. Our portal mapping matched ydotool/REL_WHEEL signs, which is correct for GNOME/generic and for the ydotool fallback — but wrong for KDE discrete.
  • Fix: detect KDE/Plasma (XDG_CURRENT_DESKTOP / DESKTOP_SESSION) and invert vertical only portal discrete steps. Horizontal and ydotool are unchanged.
  • Escape hatch: COMPUTER_USE_LINUX_PORTAL_SCROLL_INVERT=0|1 (also true/false/yes/no/on/off).

Test plan

  • Unit tests for standard vs InvertVertical axis/step mapping (including L/R unchanged, step clamp)
  • cargo test --lib remote_desktop
  • On KDE Plasma Wayland with COMPUTER_USE_LINUX_FORCE_PORTAL_POINTER=1: scroll down then up moves viewport as named
  • On non-KDE / ydotool path: polarity unchanged

Closes #56

xdg-desktop-portal-kde forwards NotifyPointerAxisDiscrete steps without
the vertical negation used on its continuous path, so direction up/down
was inverted on Plasma Wayland while ydotool REL_WHEEL stayed correct.

Detect KDE/Plasma and invert vertical portal steps only; leave horizontal
and the ydotool backend unchanged. Allow COMPUTER_USE_LINUX_PORTAL_SCROLL_INVERT
to force either polarity.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

Scroll direction is inverted on KDE Plasma Wayland

1 participant