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

            Bug ID: 528592
           Summary: Remote input dies for the rest of the session after
                    one cancelled portal dialog (m_connecting never
                    cleared)
    Classification: Applications
           Product: kdeconnect
      Version First 25.12.3
       Reported In:
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: desktop-application
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Steps to reproduce (stock GNOME, no third-party portal backend):
 1. GNOME 50 on Wayland, kdeconnect 25.12.3 (Ubuntu 26.04.1 package).
 2. From the phone, open Mousepad and send any pointer motion; the
RemoteDesktop
    permission dialog appears.
 3. Press "Deny" (or Escape) -- that is response code 1; any non-zero response,
    e.g. 2 from a backend failure, lands in the same place.
 4. Move the pointer again.

Expected: the request is retried, or at worst the dialog reappears.
Actual:   remote input never works again until kdeconnectd is restarted.
          The journal shows one line: "Failed to create session with code 1".

Cause (plugins/mousepad/waylandremoteinput.cpp, v25.12.3 and current master):

  void RemoteDesktopSession::handleXdpSessionCreated(uint code, const
QVariantMap &results)
  {
      if (code != 0) {
          qCWarning(KDECONNECT_PLUGIN_MOUSEPAD) << "Failed to create session
with code" << code << results;
          return;                       // <-- m_connecting stays true
      }
      m_connecting = false;
      m_xdpPath = ...

createSession() sets m_connecting = true before the asynchronous CreateSession
call, and isValid() is "return m_connecting || !m_xdpPath.path().isEmpty();".
After the early return, isValid() is permanently true with an empty m_xdpPath,
so
every later packet takes the "session is fine" path and none of them ever
triggers a new CreateSession.

That also produces a second, harder-to-diagnose failure mode: with no session,
Qt rejects the outgoing Notify* messages at marshalling time, so the user sees

  Marshalling failed: Invalid object path passed in arguments

repeated for every event, with no further warning (1122 of these over 26 hours
in
the incident that led to this report). Pointer motion is dropped silently.

A third route into the same state: per the org.freedesktop.portal.Request
documentation, Close() ends the interaction without emitting a Response at all,
and there is no timeout to notice a Response that never arrives. In that case a
never-arriving Response is indistinguishable from a healthy session.

Suggested fix: clear m_connecting on the code != 0 path (or in a scope guard),
and add a timeout that clears it and logs a warning if no Response arrives, so
a
missing Response cannot masquerade as an established session. Refusing to call
Notify* while m_xdpPath is empty would turn the silent marshalling failures
into
one clear message.

Note on verification: the code path above was checked against the v25.12.3
sources, against current master, and against the string present in the shipped
kdeconnect_mousepad.so. The deny/Escape steps themselves were not executed on a
stock system -- the machine where this was diagnosed runs a locally written
RemoteDesktop backend -- so they follow from the code and from the documented
Response codes rather than from a live stock run.

Note on the incident: this was diagnosed on a system using a locally written
RemoteDesktop backend, so the trigger there was the portal being unavailable at
login. The defect above is purely in the plugin's state machine, and reproduces
with stock components via the deny-dialog path; the marshalling failure mode
was
observed both ways.

---
Reported automatically by Open Interpreter
(https://github.com/endolith/open-interpreter)
after a debugging session; source references checked against upstream v25.12.3
and
master on 2026-11-09.

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

Reply via email to