Bug 463799 - Command-line kwin_x11 option to disable painting root/desktop windows
Summary: Command-line kwin_x11 option to disable painting root/desktop windows
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.26.5
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-03 21:13 UTC by Lukas Sabota
Modified: 2023-01-12 16:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Sabota 2023-01-03 21:13:19 UTC
When kwin_x11 is run outside of a normal plasma session, it is an extremely capable standalone window manager.  Currently, the only issue is that kwin paints the desktop background (X11 root window) for each monitor.  When kwin_x11 is run outside of a normal plasma session, this results in each monitor having a black background.  It's impossible to set the background using normal X11 tools such as hsetroot/feh/fbsetroot while kwin_x11 is active because of the black background that kwin is painting.

I'm not sure if it's possible (because I'm still unsure of the exact reason why kwin_x11 has this behavior), but it would be great if there was a command-line option to temporarily disable kwin handling the root windows so that X11 setroot utilities could function.

I do realize that kwin is intended for use as the Plasma window manager and compositor and not a standalone window manager.  That being said, kwin is one of the best window managers available for X11 and it would be great to be able to utilize kwin in isolation for special use-cases while retaining the ability to control the root windows.  If this isn't possible, I'd be interested to know why (I can imagine it might have something to do with the effects or virtual desktop handling, but still haven't looked in to the source enough).

Thanks again for the plasma team's hard work on kwin and plasma in general!

1. Start X11 with "exec xterm" as your ".xinitrc" or desktop session
2. Run "hsetroot -solid blue" to change the X11 root window.
3. Run "kwin_x11" and notice the root window change from blue to black.

OBSERVED RESULT
Root window changes from blue to black

EXPECTED RESULT
Would be great if there was a command-line option to kwin_x11 to allow the root window to stay blue.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  5.26
KDE Plasma Version: 5.26
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Comment 1 Lukas Sabota 2023-01-08 00:54:37 UTC
I just wanted to add another comment to further clarify:

The main issue with running kwin standalone is that the background will be black - no matter what.  If kwin could be configured to not touch the root window (as mentioned originally in this ticket) then great!
However, another solution would be to allow the user to set the wallpaper through kwin (perhaps through qdbus?).  I know there are currently dbus calls for plasma.desktop that can change the wallpaper, but I'm not aware of any that would change the wallpaper in a standalone kwin session.

I'm not sure which of these approaches would be more feasible for the kwin codebase and maintainer priorities, but I wanted to indicate that the solution could be different than what's posted in the original bug title.
Comment 2 Vlad Zahorodnii 2023-01-11 12:54:56 UTC
Can you clarify whether you use kwin as a window manager or as a window manager + compositing manager. As far as I know, kwin has no code to change the background
Comment 3 Lukas Sabota 2023-01-11 14:53:35 UTC
I use both kwin_x11 as just a window manager and I also use it as a window manager and compositing manager:  because they both seem to work exceptionally well.  I was pleasantly surprised to see how well the compositing effects (such as the META+W overview / virtual desktop animations / transparency effects) worked with kwin_x11 in standalone mode.  There did appear to be some very minor artifacting during the transition to overview mode, but it didn't prevent overview from functioning at all.
Running kwin_x11 will exhibit this black background behavior both when compositing is enabled, and it's when disabled.

I also couldn't seem to find where in kwin source code that the root window gets painted black.  I've been doing some trial and error with gdb when I've had a spare chance, but haven't yet been able to dedicate much time to investigating.
Comment 4 Vlad Zahorodnii 2023-01-12 10:43:53 UTC
The background is painted here https://invent.kde.org/plasma/kwin/-/blob/9751aca548c4c46036395bd8a7897eaa70e85397/src/scene/itemrenderer_opengl.cpp#L228

In either case, running without a desktop window is a really niche case, and I'm not sure it's worth adding an option for this.
Comment 5 Lukas Sabota 2023-01-12 16:01:28 UTC
Hi,

Just to clarify (because there may be some confusion based on the most recent response):  this bug report is not describing that a user cannot run kwin standalone without a background.  The bug describes that a user running kwin in standalone mode is forced to use a black background.

I'm not sure an option to "run without a background" was suggested, but rather some sort of facility to be able to adjust wallpaper for a running kwin session.

I completely understand if the KDE team does not want to support non-plasma use-cases (although wish they wouldn't), but I just want to make sure that my request is being understand properly before being rejected.
Thank you!
Comment 6 Lukas Sabota 2023-01-12 16:03:18 UTC
I'd also like to add that this background behavior occurs with the OpenGL renderer disabled, so the background is being painted black in more areas of the source than the single function Vlad pointed out.

Thanks!