Skip to content
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

Different Wayland Qt plugin is used in BiT (root) vs. BiT user-space #1350

Closed
aryoda opened this issue Nov 2, 2022 · 3 comments
Closed

Different Wayland Qt plugin is used in BiT (root) vs. BiT user-space #1350

aryoda opened this issue Nov 2, 2022 · 3 comments
Assignees
Labels
Bug Wayland Issues related to Wayland-based desktop environments
Milestone

Comments

@aryoda
Copy link
Contributor

aryoda commented Nov 2, 2022

Background

The display manager support (X11, Wayland) of an app with a GUI is the responsibility of the app developer.

Ubuntu installs XWayland by default if the user installs Wayland which means all apps that do not support Wayland use the X11 API of XWayland which (partially) uses Wayland internally.

We are using Qt5 in BiT which supports X11. Qt5 Wayland support requires installing the qtwayland5 package (on Ubuntu)

To use Wayland in Qt5 apps additionally the environment variable QT_QPA_ARCHITECTURE must be set to specific value
(wayland-egl).

If we do not explicitly configure the BiT launcher script to use Wayland BiT uses X11 (via XWayland on desktop environments with Wayland as display manager).

Bug

We do set this env var ONLY in the BiT (root) launcher script

#!/bin/sh
if [ "x$XDG_SESSION_TYPE" = "xwayland" ]; then
PREFIX="env QT_QPA_PLATFORM=wayland-egl XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"
else
PREFIX=""
fi
pkexec --disable-internal-agent $PREFIX "/usr/bin/backintime-qt" "$@"

but not in the BiT (userland) launcher script
export QT_GRAPHICSSYSTEM="native"
CUR_PATH="$(dirname $(readlink -m $0))"
if [ -f "${CUR_PATH}/app.py" ]; then
APP_PATH=$CUR_PATH
else
APP_PATH=$(readlink -m "${CUR_PATH}/../share/backintime/qt")
fi
python3 -Es ${APP_PATH}/app.py "$@"

so only BiT (root) uses Wayland.

This also explains why we do not see userland BiT tickets for Wayland in our issues normally.

Affected Bit versions

Current version of BiT (1.3.2) and most probably many older versions

Expected behavior

  • Both BiT versions should consistently use either X11 or Wayland on the same system
  • Both BiT versions should use the same Wayland Qt plugin on Wayland.
  • Prefer Wayland over X11 if Wayland is the active display manager

(Partially) related issues and PRs

@aryoda
Copy link
Contributor Author

aryoda commented Nov 6, 2022

FYI: I have added a logger.debug output to track the active Qt5 platform plugin (which determines if X11 or wayland is used):

> backintime-qt --debug
DEBUG: [qt/qttools.py:186 createQApplication] QT QPA platform plugin: xcb

The interpretation of the plugin name will be described in my upcomding "BiT developer's doc for wayland" (in a few days)...

@aryoda aryoda changed the title Native Wayland is used only in BiT (root) - not in BiT userland Different Wayland Qt plugin is used in BiT (root) vs. BiT user-space Nov 8, 2022
@buhtz buhtz added this to the 1.3.4 milestone Mar 19, 2023
@aryoda aryoda self-assigned this Jan 3, 2024
@aryoda
Copy link
Contributor Author

aryoda commented Jan 3, 2024

Upcoming fix is described here: #836 (comment)

aryoda added a commit to aryoda/backintime that referenced this issue Jan 4, 2024
…robing.py" hangs; Cannot launch BiT (root) on Wayland

- "qt5_probing.py" hangs when BiT is run as root and no user is logged into a desktop environment

- BiT (root) starter script does not set Qt5 wayland-egl plugin anymore but uses the default (like BiT userland)

- Improve logging (all sub process do now use the log context "backintime" too for easy journalctl grepping
aryoda added a commit to aryoda/backintime that referenced this issue Jan 4, 2024
…robing.py" hangs; Cannot launch BiT (root) on Wayland

- "qt5_probing.py" hangs when BiT is run as root and no user is logged into a desktop environment

- BiT (root) starter script does not set Qt5 wayland-egl plugin anymore but uses the default (like BiT userland)

- Improve logging (all sub processes do now use the log context "backintime" too for easy journalctl grepping
aryoda added a commit that referenced this issue Jan 4, 2024
…h BiT (root) on Wayland

* "qt5_probing.py" hangs when BiT is run as root and no user is logged into a desktop environment
*  BiT (root) starter script does not set Qt5 wayland-egl plugin anymore but uses the default (like BiT userland)
*  Different Wayland Qt plugin was used in BiT (root) vs. BiT user-space: Now no wayland is enforced anymore
*  Improve logging (all sub processes do now use the log context "backintime" too for easy journalctl filtering via the )

Was PR #1597
@aryoda
Copy link
Contributor Author

aryoda commented Jan 5, 2024

Closed with PR #1597

@aryoda aryoda closed this as completed Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Wayland Issues related to Wayland-based desktop environments
Projects
None yet
Development

No branches or pull requests

2 participants