-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panel: Use the wlroots backend with unknown Wayland compositors #2161
base: master
Are you sure you want to change the base?
Conversation
The description of the LXQtPanelApplicationPrivate::loadBackend() method already states that if we cannot identify the correct backend for a Wayland session, we should fall back to the wlroots backend module. This is reasonable given how broadly the wlr protocols are implemented. However, this was not happening due to a small error where we checked for the wlroots string in XDG_CURRENT_DESKTOP, which is not a valid option. This change fixes this by checking XDG_SESSION_TYPE for "wayland" instead. As this is fallback logic, this is safe as the preferred backend logic using XDG_CURRENT_DESKTOP still wins over this.
@@ -263,7 +263,7 @@ void LXQtPanelApplicationPrivate::loadBackend() | |||
} | |||
} | |||
|
|||
if ( preferredBackend.isEmpty() && xdgCurrentDesktops.contains( QStringLiteral("wlroots") ) ) | |||
if ( preferredBackend.isEmpty() && xdgSessionType == QStringLiteral("wayland") ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wlroots backend should be used only if wlroots
is included. That inclusion means, "we know that it works with this Wayland compositor." The dummy backed should be used with unsupported compositors.
Only for compositors that are compatible with wlroots, as far as lxqt-panel is concerned. Otherwise: lxqt-panel/panel/lxqtpanelapplication.cpp Lines 306 to 313 in 5ce16ac
|
That's not what the method description says: lxqt-panel/panel/lxqtpanelapplication.cpp Lines 193 to 203 in 246b33f
|
It's a code comment :) What exists other than X11 and Wayland? The code isn't final of course — more generic backends might be added in future — but for now, several good compositors are compatible with wlroots (except for kwin_wayland, which has its own backend; I like it very much). |
Yeah. I like KWin too. 😄 But yeah, I think it's reasonable to use the wlroots backend as a wayland fallback because outside of KWin; Mutter; and Weston, pretty much all compositors offer the wlr protocols that the backend depends on. And we already have a KWin backend, if someone actually wants to use Mutter or Weston, then backends can be made for them. 😂 |
Until the current disarray comes to an end in the Wayland world, we should thread carefully, IMO. Two years ago we didn't imagine that we could support 7 well-known Wayland compositors so soon. Yes, the situation of Wayland has got better but not completely. Also see how "wlroots" is handled in another part of the code: lxqt-panel/panel/backends/wayland/wlroots/lxqtwmbackend_wlr.cpp Lines 609 to 643 in 5ce16ac
|
Why does this method exist? We already select to load it from the panel frontend side? |
The backend is chosen in two ways: by checking the key BTW, we need to add a dedicated backend for labwc because it supports |
Sure, but does that mean that the wlroots backend isn't going to let itself be used as the least-common-denominator panel backend? |
As the lowest common denominator for the compositors that are announced to be compatible with wlroots by |
Then we should use a separate variable for this, because XDG_CURRENT_DESKTOP isn't the right place for it. |
This logic was a result of our developers' hard works and long discussions. It's proven to work fine and flexibly. That being said, it isn't written in stone. If another method is shown to be better in practice, it could be replaced. Anyway, LXQt 2.1.0 will be released with it the day after tomorrow. |
We could just read the compositor in use as in |
No, it's not that simple. We've used lxqt-panel/panel/lxqtpanel.cpp Lines 262 to 270 in 5ce16ac
|
Using lxqt-panel/panel/backends/wayland/kwin_wayland/lxqtwmbackend_kwinwayland.cpp Lines 800 to 803 in 5ce16ac
Moreover, a Wayland compositor is a DE too. EDIT: |
The description of the LXQtPanelApplicationPrivate::loadBackend() method already states that if we cannot identify the correct backend for a Wayland session, we should fall back to the wlroots backend module. This is reasonable given how broadly the wlr protocols are implemented. However, this was not happening due to a small error where we checked for the wlroots string in XDG_CURRENT_DESKTOP, which is not a valid option.
This change fixes this by checking XDG_SESSION_TYPE for "wayland" instead. As this is fallback logic, this is safe as the preferred backend logic using XDG_CURRENT_DESKTOP still wins over this.