Bug 457491

Summary: automaticBackendSelection() could be more verbose
Product: [Plasma] kwin Reporter: Dan <dan76>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dan 2022-08-04 19:04:17 UTC
There're many reports of users trying to use Wayland and just seeing a black screen. Since I was one of these users and I found the solution on Bug 456337, here is a suggestion to improve the situation.

In the src/main_wayland.cpp, the automaticBackendSelection() will select the backend based on WAYLAND_DISPLAY or DISPLAY environment variables. So, if the user sets the DISPLAY variable, automaticBackendSelection() will use the X11 backend (and never use DRM backend), so the user will be stuck with a black screen:

static QString automaticBackendSelection()
{
    if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) {
        return s_waylandPlugin;
    }
    if (qEnvironmentVariableIsSet("DISPLAY")) {
        return s_x11Plugin;
    }
    return s_drmPlugin;
}

It would be nice if it could be more verbose, like "DISPLAY environment variable detected. Using X11 backend" or "WAYLAND_DISPLAY environment detected. Using Wayland backend". So the log will help the user to understand that if (s)he wants to use the DRM backend, (s)he cannot set those environment variables.

Thank you!
Comment 1 Bug Janitor Service 2022-08-04 19:29:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2780
Comment 2 Zamundaaa 2022-08-05 01:11:28 UTC
Git commit 02f55e0e40b5012b425cc3d6834509d5cafbffbd by Xaver Hugl.
Committed on 05/08/2022 at 00:58.
Pushed by zamundaaa into branch 'master'.

wayland: print warning about automatic backend selection

M  +3    -0    src/main_wayland.cpp

https://invent.kde.org/plasma/kwin/commit/02f55e0e40b5012b425cc3d6834509d5cafbffbd