NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.05k forks source link

tdesktop?: .telegram-desktop-wrapped crashes because of QT_QPA_PLATFORM=wayland, but normal telegram-desktop starts up fine #218370

Closed ghost closed 7 months ago

ghost commented 1 year ago

Describe the bug

So, aside from what title says, I tried to join a Telegram chat or channel using the web interface (shows you a page for the user, chat or channel and shows a button to join it, which opens/triggers Telegram), but nothing happens. Checking logs, I get an error message that's essentially what the title says.

Steps To Reproduce

Steps to reproduce the behavior:

  1. try to joining something with Telegram's web interface
  2. press the button to open or trigger Telegram
  3. Nothing happens

Expected behavior

Telegram either opens or receives the data and shows the user, group chat or channel so they can join

Additional context

I use Firefox currently as browser. Also tried it with Chrome and Gnome Web, same thing.

Notify maintainers

@NickCao

Metadata

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

 - system: `"x86_64-linux"`
 - host os: `Linux 6.0.10-zen2, NixOS, 22.11 (Raccoon), 22.11.2720.50c23cd4ff6`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixos-22.11"`
 - channels(m911t): `"home-manager-22.11.tar.gz"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
NickCao commented 1 year ago

I'm also using firefox, tried joining https://t.me/durov from browser but failed to reproduce the issue (on nixos-unstable). May you clarify the situation a bit: the error message is printed by which application, firefox or telegram? Is telegram already running when you click the link? And what's your desktop environment, are you using wayland?

ghost commented 1 year ago

Ah, i'm on nixos stable. ok, i'll give more details:

  1. The message is generated by .telegram-desktop-wrapped

    feb 26 09:23:04 Taihou .telegram-desktop-wrapped[127642]: qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
    feb 26 09:23:04 Taihou .telegram-desktop-wrapped[127642]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
                                                          Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb.
  2. The message is the same if Telegram is already opened or not.
  3. DE is GNOME
  4. I am indeed using wayland and I have QT_QPA_PLATFORM set to wayland. I don't understand why the .telegram-desktop-wrapped executable can't use wayland when the telegram-desktop one can.
NickCao commented 1 year ago

Check ~/.local/share/applications, and try removing userapp-Telegram Desktop-*.desktop. My theory is that telegram itself generates these broken (qt plugins search paths are set in the wrapper, without it they indeed could not be found) desktop entries, and is later used by browsers to launch telegram, causing the issue you are seeing now.

ghost commented 1 year ago

indeed, you were right. Removing those things fixed the issue. How can this be prevented in the first place though?

NickCao commented 1 year ago

We can patch tdesktop to avoid it generating any desktop entry, and optionally provide one ourselves, let me investigate about this in coming days.

ghost commented 1 year ago

nice! Thank you

SuperSandro2000 commented 7 months ago

fixed a year ago by the linked PR