feat: add own_window_namespace config setting for wlr-layer-shell - #2435
sniper1720 wants to merge 4 commits into
Conversation
…brndnmtthws#2432) KWin classifies layer-shell surfaces by namespace; using "desktop" for own_window_type = 'desktop' keeps widgets visible during Show Desktop, matching the X11 backend.
✅ Deploy Preview for conkyweb canceled.
|
|
I can confirm the fix is working. If it relevant: I'm using Debian 13 with KDE 6.3.6. Wayland (Obviously). |
Thanks for testing and confirming! I hope this PR gets merged soon so I can replace my patched AppImage with the official build for my custom Conky themes. |
|
@sniper1720 Your Pure theme looks very good! Great minds think alike. 😄 |
|
@sniper1720 , @brndnmtthws KWin's With this PR and One thing I hit while testing further: on KWin the namespace and the layer are
Decoupling them is a few lines. In #ifdef BUILD_WAYLAND
conky::simple_config_setting<std::string> own_window_namespace(
"own_window_namespace", PACKAGE_NAME, false);
#endifand at the
Tested on Plasma/KWin 6.6.5 Wayland, conky 1.24.2 built from source. Happy to |
Thank you for the kind words, I appreciate it! |
I'm glad this PR brought out all this potential and even revealed a hidden bug and better concept! Honestly, I didn't catch that issue while testing my Conky themes on KDE Plasma. The The coupling problem you hit is real, and I ran into it as well. On KDE, What I suggest (though I'm open to discussion) is to wait for this PR to land first, and then we can open a follow-up PR adding Thanks for the thorough testing and analysis. I'm happy to collaborate on the follow-up if you're up for it! |
✅ Deploy Preview for conkyweb canceled.
|
|
I honestly couldn't be more patient after @rcspam's hint and the whole thread, I went and played with the code directly. I changed a few lines and found a recipe that actually works end to end, tested on real hardware. What I changed Replaced the hardcoded std::string namespace_str = own_window_namespace.get(*state);
if (namespace_str.empty()) {
switch (own_window_type.get(*state)) {
case window_type::DESKTOP: namespace_str = "desktop"; break;
case window_type::DOCK: namespace_str = "dock"; break;
case window_type::PANEL: namespace_str = "panel"; break;
default: namespace_str = PACKAGE_NAME; break;
}
}
What I tested, and with what Built my fork of conky as a
Verified on KWin:
I'd love your feedback and any suggestions on the approach before calling this merge-ready, especially on whether the type-derived default feels right. |
|
Hi @sniper1720 , One thing though: I would keep conky as the default. Today every conky uses that namespace. With your default, someone running own_window_type = 'dock' suddenly gets the dock namespace, and KWin starts treating their conky as a dock. Their conky changes behaviour on its own, they did not ask for anything. Keep conky as the default and nobody is affected. Whoever wants the fix adds one line: own_window_namespace = 'desktop'. Details, for the record:
I have only read the diff, I have not rebuilt your |
247e170 to
a04fcde
Compare
Thanks for the review! Keeping
Validated on KDE Plasma 6 Wayland via a patched AppImage with our themes setting the namespace explicitly. Would love your take on the updated commit. Anything you'd change? |
|
Looks good to me now, nothing blocking. One data point worth putting in the docs: with own_window_namespace = 'dock', conky jumped in front of everything while switching virtual desktops, then dropped back. That is KWin's slide effect, shouldElevate() returns isDock() (src/plugins/slide/slide.cpp), so docks get elevated for the duration of the animation. Switching to 'desktop' fixed it here, conky stays in the background throughout. Another reason your doc entry is right to recommend it. Two nits:
Also, your namespace list is right as is. KWin has a typo in that table, the key reads "crititical-notification" from 6.4 through 6.7 and is fixed only on master, so leaving it out is the accurate call. |
Guard the declaration in gui.h under BUILD_WAYLAND to match the definition, and add a doc comment covering KWin namespace classification. Extend the docs to note that the slide effect elevates dock surfaces, so 'desktop' keeps conky in the background.
Applied all three:
@rcspam Thanks again for the review and the working data point on the slide behavior! |
|
Confirmed on my side, all three points are addressed. Nothing blocking. Two leftovers, both cosmetic:
Also double-checked |
Set the default once as PACKAGE_NAME in gui.cc rather than pairing an empty default with a runtime fallback in display-wayland.cc, and sort the entry alphabetically in the docs. An explicit own_window_namespace = '' now reaches the compositor as an empty scope instead of falling back to 'conky'.
Applied both, confirmed.
This also confirms the whole feature is scoped correctly: it only affects compositors with |


Checklist
doc/has been updatedDescription
The changes: a new
own_window_namespaceconfig setting for thenamespacepassed toget_layer_surface(). It defaults to"conky"(unchanged behaviour for every existing config); a user can opt in to another classification, e.g.own_window_namespace = 'desktop'for desktop-widget behaviour. The setting is guarded byBUILD_WAYLANDonly.Why they were necessary: on KDE Plasma (Wayland), KWin derives the window type from the layer-shell namespace via
scopeToType()."conky"is not in its map, so every conky surface is classifiedWindowType::Normalregardless of the layer it is on. Normal windows are whatWorkspace::setShowingDesktop()hides, so Show Desktop (Meta+D) hides conky desktop widgets even though they sit on theBACKGROUNDlayer. The setting also lets dock/normal users decouple classification from the layer, e.g. keepown_window_type = 'normal'on the bottom layer while KWin still treats the surface as a desktop window.How it affects existing behaviour: nothing changes for existing configs: the namespace stays
"conky"unlessown_window_namespaceis set explicitly. Configs that setown_window_namespace = 'desktop'stay visible during Show Desktop on KDE Plasma, matching the X11 backend.How it was tested: built and shipped as a patched AppImage (
v1.24.3-patched.2); verified interactively on KDE Plasma 6 (Wayland): desktop widgets stay on screen through repeated Meta+D cycles withown_window_namespace = 'desktop'. The X11 backend is untouched.Closes #2432