NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.14k stars 14.17k forks source link

23.05 & 23.11 Issues with Qt applications (dark theme and emoji rendering) #271879

Open unclechu opened 11 months ago

unclechu commented 11 months ago

Describe the bug

Since I migrated from 22.11 to 23.05 (and now to 23.11 where all the issues still persist) I got some bugs that I see every day. I was lazy about reporting it earlier, and hoped it would be fixed in 23.11 by some Qt libs update for example. But now in 23.11 it’s still there as in 23.05.

  1. keepassxc (Qt-based app) starts using dark or light color scheme with approximately 50%/50% chance (it’s supposed to be dark by the config):

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

    2023-12-03 16-11-50

    2023-12-03 16-12-08

    I can’t figure out a pattern, to me it seems random. I can’t say whether it would be a light or dark theme when I run the app, can’t tell what it depends on. I can just run and close it in a loop and it would randomly be one or another. The log is always empty, I don’t see any errors or warnings.

    In 22.05 it was working just fine. Always the dark theme, as configured in my NixOS config.

  2. The second issue is in nheko (QML app) with emojis. They are not rendered in the message typing field, and in the quick search (by Ctrl+K). But everywhere else it’s rendered just fine (rooms list, chat, etc.). In 22.05 emojis were rendered properly everywhere. When I migrated to 23.05 the Nheko version did not change, so I can tell for sure it’s not an internal regression in Nheko.

    2023-12-03 16-22-03

    2023-12-03 16-22-15

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure Qt theme to be dark like this:

    qt = {
     enable = true;
     platformTheme = "gnome";
     style = "adwaita-dark";
    };
  2. Run and close keepassxc in a loop multiple times

  3. Observe that it rendered with either light or dark theme randomly picking one or another

  4. In Nheko try to type an emoji (using : sign or copy-paste it from somewhere)

  5. Observe it’s either square box (unknown char) or a plain text (non-colored) sign

Expected behavior

  1. keepassxc to always start with a dark theme.
  2. Emojies in Nheko to be rendered both in the message typing field and quick search window

Screenshots

KeePassXC:

2023-12-03 16-12-08 2023-12-03 16-11-50

Nheko:

2023-12-03 16-22-15 2023-12-03 16-22-03 2023-12-03 16-21-51 2023-12-03 16-21-10

Additional context

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

Notify maintainers

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.3, NixOS, 23.11 (Tapir), 23.11.1115.5de0b32be6e8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos, nixos-unstable"`
 - channels(wenzel): `"nixpkgs-test"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
unclechu commented 11 months ago

I can add an example of another Qt application that has Emoji rendering issues — psi-plus. This I see in the roster (contact list): 2023-12-07 03-30-41

becknik commented 11 months ago

First of all, I can confirm @unclechu's keepassxc behavior.

Additionally, it seems like I'm facing a extende "dark-theme" issues on some KDE apps under GNOME with the same settings. The general theming in qt apps seems like a bit of a mess to me... Can anyone approve the broken theming on the following apps following my settings?

Additional context

My system configuration: dotfiles.nix

Settings for Qt integration (nixos/gnome.nix:l.118): BackgroundNormal=#2E2E2E

  ## Leftover KDE Support
  qt = {
    enable = true;
    platformTheme = "gnome"; # leverages qgnomeplatform package; redundant due to gnome.core-os-services
    style = "adwaita-dark";
  };

~/.config/kdeglobals:

[Colors:View]
BackgroundNormal=#2E2E2E

[General]
TerminalApplication=gnome-terminal

[KDE]
ShowDeleteCommand=false

Screenshots

libsForQt5.gwenview:

Screenshot from 2023-12-08 22-16-05

libsForQt5.konsole:

Screenshot from 2023-12-08 22-16-21

libsForQt5.okular:

Screenshot from 2023-12-08 22-21-09

libsForQt5.kate:

Screenshot from 2023-12-08 22-14-34

libsForQt5.kate (without the BackgroundNormal=#2E2E2E value in ~/.config/kdeglobals):

image

kwrite:

Screenshot from 2023-12-08 22-20-29

Properly themed apps

On my system, just tried out a few ones

Additionally notifying the maintainers of the qt.nix file: @romildo @thiagokokada