Skip to content

nixos/qt: qt.platformTheme = "gtk2"; breaks qt6 programs (pcmanfm-qt, telegram-desktop and keepassxc) in a pure wayland environment #342115

Description

@Schweber

Describe the bug

If i set

  qt = {
    enable = true;
    style = "gtk2";
    platformTheme = "gtk2";
  };

then pcmanfm-qt, telegram-desktop and keepassxc fail with Gtk-WARNING **: 20:09:24.876: cannot open display: in a pure wayland environment. They do work in xwayland though. Other (maybe older/qt5) programs are not affected.

If i delete the settings or set e.g.

  qt = {
    enable = true;
    platformTheme = "qt5ct";
    style = "adwaita-dark";
  };

then the programs work.

Steps To Reproduce

Steps to reproduce the behavior:

  1. see above

Expected behavior

I would like the gtk theme to be adopted by qt in a wayland environment as it is in an X11 environment.

Additional context

lxqt/pcmanfm-qt#1939
#333964

Notify maintainers

@NixOS/qt-kde

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.10, NixOS, 24.11 (Vicuna), 24.11.20240913.345c263`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux, x86_64-v4-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/sperber/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/sperber/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/sperber/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/sperber/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/rgpx7kwskibyk067x8bp8a6ihk17fizm-lix-2.91.0/share`
 - nixpkgs: `/nix/store/l3amk5lsakpc93him5kry24kax23sn4h-source`

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions