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

Opening different QT applications with systems QT_QPA_PLATFORM #1193

Closed
VietTralala opened this issue Feb 3, 2023 · 9 comments
Closed

Opening different QT applications with systems QT_QPA_PLATFORM #1193

VietTralala opened this issue Feb 3, 2023 · 9 comments
Assignees

Comments

@VietTralala
Copy link

Description

I just updated to version 0.20.3 (I am coming from 0.17* and skipped the major update at 0.18). I am using the file extension to search for pdfs and start them in my default viewer okular. This was working fine before but now okular starts in an unreadable state. However if I manually go to the pdf via my local file manager and open the pdf then everything works as expected. I suspect that this bug is related to the wayland issues at #958
because there it is suggested to start albert with QT_QPA_PLATFORM=xcb albert. So I tried to start okular with different QT settings.

If I call okular from the terminal and using the system QT settings everything works.

However calling QT_QPA_PLATFORM=xcb okular will lead to the same buggy okular:
image

My env QT settings are:

QT_QPA_PLATFORMTHEME=qt6ct
QT_IM_MODULE=ibus
QT_QPA_PLATFORM=wayland
QT_AUTO_SCREEN_SCALE_FACTOR=1

I also tried to start albert without overwriting the env variable but then nothing works. Albert already crashes when trying to display the settings...

Expected behavior

opening files/applications using the system env parameters

Source

installed from https://aur.archlinux.org/packages/albert

Debug output

  Albert version: 0.20.3
            Build date: Feb  2 2023 21:43:57
            Qt version: 6.4.2
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/5.10.164-1-MANJARO
                    OS: Manjaro Linux
     OS (type/version): manjaro/unknown
 $QT_QPA_PLATFORMTHEME: qt6ct
         Platform name: xcb
       Binary location: /usr/bin/albert
                  $PWD: /home/viet
                $SHELL: /bin/bash
                 $LANG: en_US.UTF-8
              Language: English
                Locale: en_US
     $XDG_SESSION_TYPE: wayland
  $XDG_CURRENT_DESKTOP: GNOME
      $DESKTOP_SESSION: gnome
  $XDG_SESSION_DESKTOP: gnome
...
# rest which does not contain anything related to okular except when I started okular the below warning appeared:
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
# however this warning also appears when starting okular from the terminal
@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented Feb 10, 2023

QT_QPA_PLATFORM=xcb albert

using xcb is rather a last resort which may work for usual apps but is bad for app launchers. i unset the var from env, but I wonder if launched apps will pick up your qt6ct env.

@ManuelSchneid3r
Copy link
Member

Probably it'd better to put some work into https://github.com/Skycoder42/QHotkey such that it does not segfault on wayland.

@VietTralala
Copy link
Author

QT_QPA_PLATFORM=xcb albert

using xcb is rather a last resort which may work for usual apps but is bad for app launchers. i unset the var from env, but I wonder if launched apps will pick up your qt6ct env.

Thank you for fixing this so quickly!

@ManuelSchneid3r
Copy link
Member

Check 0.20.8 does it work out?

@VietTralala
Copy link
Author

Oh I thought it would be fixed however I just installed albert newly from https://aur.archlinux.org/packages/albert-git
and okular is still displayed wrongly when called from albert.

I checked the albert version and the QT env variables but they seem to be correct.

$ albert --version
albert 0.20.8
$ env | grep QT
QT_QPA_PLATFORM=wayland
QT_QPA_PLATFORMTHEME=qt6ct
QT_IM_MODULE=ibus
QT_AUTO_SCREEN_SCALE_FACTOR=1

@ManuelSchneid3r
Copy link
Member

Well that's what I expected. Setting xcb is not a real solution since envs are inherited. Are there any errors printed when it crashes if you run Albert with Wayland platform?

@VietTralala
Copy link
Author

Interestingly Albert does not crash anymore when run without setting xcb as platform. The bug with okular remains even when not setting xcb.
Here is output when starting albert:

$ albert -d
        Albert version: 0.20.8
            Build date: Feb 14 2023 16:51:59
            Qt version: 6.4.2
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/5.15.93-1-MANJARO
                    OS: Manjaro Linux
     OS (type/version): manjaro/unknown
 $QT_QPA_PLATFORMTHEME: qt6ct
         Platform name: wayland
                  Font: DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1
       Binary location: /usr/bin/albert
                  $PWD: /home/viet/Downloads/albert-git
                $SHELL: /bin/bash
                 $LANG: en_US.UTF-8
              Language: English
                Locale: en_US
     $XDG_SESSION_TYPE: wayland
  $XDG_CURRENT_DESKTOP: GNOME
      $DESKTOP_SESSION: gnome
  $XDG_SESSION_DESKTOP: gnome
            Icon theme: hicolor

and with xcb:

$ QT_QPA_PLATFORM=xcb albert -d
        Albert version: 0.20.8
            Build date: Feb 14 2023 16:51:59
            Qt version: 6.4.2
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/5.15.93-1-MANJARO
                    OS: Manjaro Linux
     OS (type/version): manjaro/unknown
 $QT_QPA_PLATFORMTHEME: qt6ct
         Platform name: xcb
                  Font: DejaVu LGC Sans,12,-1,5,400,0,0,0,0,0,0,0,0,0,0,1
       Binary location: /usr/bin/albert
                  $PWD: /home/viet/Downloads/albert-git
                $SHELL: /bin/bash
                 $LANG: en_US.UTF-8
              Language: English
                Locale: en_US
     $XDG_SESSION_TYPE: wayland
  $XDG_CURRENT_DESKTOP: GNOME
      $DESKTOP_SESSION: gnome
  $XDG_SESSION_DESKTOP: gnome
            Icon theme: hicolor

@ManuelSchneid3r
Copy link
Member

Dropped the QT_QPA_PLATFORM unsetting line. Will be in the next version. Please help getting things to work without this xcb hack, since it simply does not apply to application launchers.

@ManuelSchneid3r
Copy link
Member

have you had problems using this QT_QPA_PLATFORM=xcb albert -d? I wonder why unsetting did not work out? the only problem I see is if somebody exports QT_QPA_PLATFORM=xcb globally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants