Skip to content

Scroll direction is inverted on KDE Plasma Wayland #56

Description

@Cowation

What happened?

On KDE Plasma Wayland, the scroll MCP tool scrolls vertically in the opposite direction from the requested direction:

  • direction: "down" scrolls upward.
  • direction: "up" scrolls downward.

This occurs when input is sent through the XDG RemoteDesktop portal.

Tracing v0.4.1 shows that computer-use-linux maps the directions in src/remote_desktop.rs as:

ScrollDirection::Up => (AXIS_VERTICAL, steps.max(1)),
ScrollDirection::Down => (AXIS_VERTICAL, -steps.max(1)),

The KDE portal passes this signed discrete value directly to the Wayland vertical-scroll axis:

m_fakeInput->axis(
    WL_POINTER_AXIS_VERTICAL_SCROLL,
    wl_fixed_from_double(delta)
);

KDE's continuous-axis implementation, however, explicitly negates the vertical value:

m_fakeInput->axis(
    WL_POINTER_AXIS_VERTICAL_SCROLL,
    wl_fixed_from_double(-y)
);

The observed reversal therefore appears to be a polarity mismatch in the discrete portal path.

The ydotool fallback uses Linux REL_WHEEL semantics and should be handled separately. An unconditional global sign flip could break that backend.

Environment:

computer-use-linux: 0.4.1
Installation: prebuilt x86_64 release packaged through Nix
NixOS: 26.11.20260719.241313f (Zokor)
KDE Plasma: 6.7.3
xdg-desktop-portal: 1.20.4
xdg-desktop-portal-kde: 6.7.3
Session: Wayland
Portal pointer forced: COMPUTER_USE_LINUX_FORCE_PORTAL_POINTER=1

Steps to reproduce

  1. Run KDE Plasma on Wayland with computer-use-linux configured to use the portal pointer backend:

    COMPUTER_USE_LINUX_FORCE_PORTAL_POINTER=1
    
  2. Start the MCP server:

    computer-use-linux mcp
  3. Open an application containing enough content to scroll vertically.

  4. Place the pointer over its scrollable area, or target the window through the scroll tool.

  5. Call:

    {
      "direction": "down",
      "pages": 1
    }
  6. Observe that the application scrolls upward.

  7. Call:

    {
      "direction": "up",
      "pages": 1
    }
  8. Observe that the application scrolls downward.

The tool reports success through the RemoteDesktop portal in both cases.

Expected behavior

The direction names should describe the resulting viewport movement consistently across input backends:

  • direction: "down" should move the viewport downward through the document.
  • direction: "up" should move the viewport upward through the document.

Portal and ydotool backends should normalize their native axis conventions internally so callers do not need backend-specific reversed directions.

Version

agentsys and agnix are not installed because computer-use-linux is installed directly as a NixOS package.

Platform

Codex CLI

OS

NixOS 26.11 (Unstable)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions