Bug 457491 - automaticBackendSelection() could be more verbose
Summary: automaticBackendSelection() could be more verbose
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-04 19:04 UTC by Dan
Modified: 2022-08-05 01:11 UTC (History)
0 users

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 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