Bug 442662

Summary: KWindowSystem on Wayland is missing many signals, some of which are needed by Yakuake
Product: [Frameworks and Libraries] frameworks-kwindowsystem Reporter: Firlaev-Hans <firlaevhans.fiete>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: ipha00, kde, nate, oded
Priority: NOR Keywords: wayland
Version: 5.86.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Firlaev-Hans 2021-09-18 15:54:18 UTC
Yakuake, the drop-down terminal, uses signals in KWindowSystem (https://api.kde.org/frameworks/kwindowsystem/html/classKWindowSystem.html) for some functionality, such as activeWindowChanged() to check if it has lost focus.
The needed signals are not implemented in the Wayland version of KWindowSystem, which causes lots of issues with Yakuake's behavior (e. g. it can't retract automatically upon loosing focus (See Bug 380497), it can't stay on top of other Windows and more)
Comment 1 David Edmundson 2021-10-01 11:45:52 UTC
Yakuake having issues should be fixed, but not with this approach.

Wayland is different, trying to shoehorn that into the exact same abstractions simply won't work. 

Lets split this up as individual bugs on yakuake.
Comment 2 Oded Arbel 2021-10-01 23:36:20 UTC
(In reply to David Edmundson from comment #1)
> Lets split this up as individual bugs on yakuake.

There are already individual bugs on Yakuake - this ticket was to upstream all the issues that arise from Yakuake depending on KWindowSystem signaling for several features.

@Firlaev-Hans - here is a summary of a discussion I had today on #plasma:kde.org:

----8<----
David Redondo (regarding the activeWindowChanged() signal): The signal will never be more useful than QGuiApplication::focusWindowChanged because on wayland the only thing the application can know if it's focused or not.
KWindowSystem was never necessary to know if you have focus

zzag: it's a bit difficult. due to kwindowsystem being x11 oriented historically, activewindowchanged can be used to monitor the active window [me: this is a big no-no in Wayland]
but yeah, with wayland, kwindowsystem makes sense only for things such as setting blur, server side drop shadows
i.e. manipulating your own windows
if you want to manage foreign windows, use libtaskmanager
we need to deprecate and split a bunch of stuff for kwindowsystem in kf6, but due to being busy with other sutff, I don't think that anybody has started work on it
----8<----

So, yea - Yakuake will either have to find cross-platform way of doing things that it relied on KWindowSystem for before (e.g. QGuiApplication::focusWindowChanged) or implement two different code paths for X11 and Wayland for more complicated things. As an example for this approach, I looked at the MR in https://invent.kde.org/plasma/kactivitymanagerd/-/merge_requests/16 , where KActivityManager's VirtualDesktopSwitchPlugin was modified to test `KWindowSystem::isPlatformX11()` and if so use KWindowSystem, otherwise use a Wayland-specific implementation.