https://bugs.kde.org/show_bug.cgi?id=526783

            Bug ID: 526783
           Summary: Pointer input broken with --virtual-monitor: every
                    motion maps to (0,0)
    Classification: Plasma
           Product: KRdp
      Version First 6.7.5
       Reported In:
          Platform: openSUSE
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

DESCRIPTION
When krdpserver runs with --virtual-monitor, pointer input from the RDP
client does not work: every mouse motion is mapped to position (0,0) on
the virtual output. With Plasma's default top-left hot corner, each mouse
movement re-triggers Overview, so the remote session is unusable.

Screencasting::createVirtualMonitorStream() in src/screencasting.cpp
never sets stream->d->m_size. createOutputStream() and
createRegionStream() both set it. PlasmaScreencastV1Session then calls
setLogicalSize(d->request->size()) with an empty size, and the pointer
mapping in PlasmaScreencastV1Session::sendEvent() multiplies every
coordinate by 0:

    auto logicalPosition = QPointF{(position.x() / size().width()) *
logicalSize().width(), (position.y() / size().height()) *
logicalSize().height()};

The same code is still on master (aa88b13).

STEPS TO REPRODUCE
1. On a machine with no physical display connected, run:
   krdpserver --plasma --virtual-monitor 1920x1080@1
2. Connect with an RDP client (here: Microsoft Windows App on macOS)
   and log in.
3. Move the mouse inside the remote session.

OBSERVED RESULT
The pointer stays in the top-left corner of the virtual output. Overview
opens again and again, and clicks land in the corner, so menus and
windows can't be used. Keyboard input works normally.

EXPECTED RESULT
The pointer follows the client's mouse across the virtual output.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20261005
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
Graphics Platform: Wayland
krdp: 6.7.5
FreeRDP: 3.32.1
RDP client: Microsoft Windows App (macOS)

ADDITIONAL INFORMATION
Setting the stream size to the logical size of the virtual output
(resolution divided by the scale) fixes the pointer mapping. The patch
below applies cleanly to both v6.7.5 and master. It was found and
written with AI assistance.

POTENTIAL FIX
diff --git a/src/screencasting.cpp b/src/screencasting.cpp
index ea9a4d8..97bd1ea 100644
--- a/src/screencasting.cpp
+++ b/src/screencasting.cpp
@@ -148,6 +148,7 @@ ScreencastingStream
*Screencasting::createVirtualMonitorStream(const QString &na
 {
     auto stream = new ScreencastingStream(this);
     stream->d->init(d->stream_virtual_output(name, resolution.width(),
resolution.height(), wl_fixed_from_double(dpr), mode));
+    stream->d->m_size = (QSizeF(resolution) / dpr).toSize();
     return stream;
 }

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to