Bug 503499

Summary: KDE Connect pointer causes fullscreen presentations to lose focus on Wayland
Product: [Applications] kdeconnect Reporter: Rafael Barbosa <rafayuri>
Component: commonAssignee: Albert Vaca Cintora <albertvaka>
Status: REPORTED ---    
Severity: normal CC: andrew.g.r.holmes, luna_kde
Priority: NOR    
Version First Reported In: 25.04.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Rafael Barbosa 2025-04-29 03:27:04 UTC
**Summary:**
When using KDE Connect's "remote control for presentations" pointer on Plasma Wayland, activating the pointer window causes fullscreen presentation windows to lose focus. As a result, the Plasma taskbar becomes visible during fullscreen presentations, breaking the visual experience. This does not happen on X11.

**Steps to reproduce:**
1. Login to a Plasma Wayland session.
2. Open any presentation application (e.g., LibreOffice Impress, Okular) in fullscreen mode.
3. Connect a phone via KDE Connect.
4. Use the "Remote Input" or "Presentation Remote" to activate the pointer.

**Observed behavior:**
- The presentation window loses fullscreen focus.
- The Plasma taskbar becomes visible on top of the presentation.
- Interaction is disrupted, and the presentation looks broken.

**Expected behavior:**
- The presentation window should remain fullscreen and focused.
- The pointer should overlay without stealing window focus or affecting fullscreen.

**Technical analysis:**
- The pointer window is created with `Qt::WindowDoesNotAcceptFocus` and several flags like `Qt::Tool`, `Qt::FramelessWindowHint`, etc.
- However, on Wayland, just creating a new top-level window is enough to cause focus changes.
- Proper Wayland behavior would require using layer-shell protocol (e.g., with a surface layer like overlay/background) or input-inhibition protocols.
- Simply setting window flags is not enough under Wayland security rules.

**Environment:**
- Plasma 6.3.4 / Wayland session
- KDE Connect version: 25.04
- Qt version: 6.9.0
- Distribution: Fedora Linux

**Possible solution:**
- Create the pointer window using layer-shell protocol (Plasma/KWin supports this).
- Alternatively, create a pointer surface that doesn't affect the focus stack.

**Additional information:**
- Problem does not occur under X11.
- Using XWayland for KDE Connect does not fix the issue either.

Thanks for the awesome work on KDE Connect!

P.S.: Analysis done with the help of chatgpt!
Comment 1 luna_kde 2025-06-20 05:10:23 UTC
For related reasons, the presentation remote is completely broken on some other compositors (see this niri issue: https://github.com/YaLTeR/niri/issues/770)

That would also be fixed by using the layer-shell protocol, as suggested here and mentioned in the linked niri issue.

Relevant page about the protocol: https://wayland.app/protocols/wlr-layer-shell-unstable-v1