NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.36k stars 14.31k forks source link

Synology Client: Needing rewrapping with wrapQtAppsHook #310505

Open ailelix opened 6 months ago

ailelix commented 6 months ago

Describe the bug

Launching Synology Drive Client with fuzzel app launcher, nothing happens

Launching in terminal, it printed

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

I guess it could be fixed with the new wrapQtAppsHook

Steps To Reproduce

  1. NixOS Setup with: (MyDotfiles)

    Hyprland with xwayland Hyprland ENVs on QT:

    "QT_AUTO_SCREEN_SCALE_FACTOR, 1" "QT_QPA_PLATFORM, wayland" "QT_WAYLAND_DISABLE_WINDOWDECORATION, 1"

  2. Launching Synology Drive Client

Expected behavior

A normal synology drive client would start

Notify maintainers

@jcouyang @MoritzBoehme

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.8.9, NixOS, 24.05 (Uakari), 24.05.20240507.b211b39`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/f0ssy3p6898x9k880l23mhd0fl6rvrb2-source`

Add a :+1: reaction to issues you find important.

MoritzBoehme commented 6 months ago

Sorry, I just saw this issue. I could not reproduce the error on my end (also hyprland). But I'm trying my best to get back to you with a fix soon.

michelealbrigo commented 6 months ago

Sorry, I just saw this issue. I could not reproduce the error on my end (also hyprland). But I'm trying my best to get back to you with a fix soon.

I'm on Unstable+Plasma6+Wayland, and I am experiencing the issue. Let me know if I can help you with any troubleshooting data.

MoritzBoehme commented 6 months ago

I'm on Unstable+Plasma6+Wayland, and I am experiencing the issue. Let me know if I can help you with any troubleshooting data.

Thanks, that's a great starting point for me!

MoritzBoehme commented 6 months ago

I was unable to reproduce the issue this evening on Plasma6. I made a project for reproduction here: https://git.moritzboeh.me/moritz/synology-drive-vm I will try hyprland tomorrow. Could you try deleting ~/.SynologyDrive/SynologyDrive.app/ in the meantime? This has resolved issues in the past if I remember correctly...

MoritzBoehme commented 6 months ago

@ailelix when trying to open your dotfiles I get a 404 error, maybe the repo is private?

michelealbrigo commented 6 months ago

I was unable to reproduce the issue this evening on Plasma6. I made a project for reproduction here: https://git.moritzboeh.me/moritz/synology-drive-vm I will try hyprland tomorrow. Could you try deleting ~/.SynologyDrive/SynologyDrive.app/ in the meantime? This has resolved issues in the past if I remember correctly...

Quick check: removing .SynologyDrive fixes the startup problem (good to know!), tomorrow I'll try the build.

MoritzBoehme commented 6 months ago

Great to hear 👍 I'll have a look to see if we should just wrap the binary to do this automatically... What build exactly do you mean?

michelealbrigo commented 6 months ago

Great to hear 👍 I'll have a look to see if we should just wrap the binary to do this automatically... What build exactly do you mean?

https://git.moritzboeh.me/moritz/synology-drive-vm this one. I am no expert in the matter (I'm trying to contribute to the issue resolution, since I really need it 😅), I expect it to build a vm with my current NixOS status, so that I can try to run the client and report back errors, did I get that right?

MoritzBoehme commented 6 months ago

Ah, that makes sense. I will try to work further on this in the coming days. It's just that I have some midterm exams coming up and have a lot to do for my Bachelor's thesis at the moment :(. Is the deletion of the directory a hack that works for now though?

MoritzBoehme commented 5 months ago

https://git.moritzboeh.me/moritz/synology-drive-vm this one. I am no expert in the matter (I'm trying to contribute to the issue resolution, since I really need it 😅), I expect it to build a vm with my current NixOS status, so that I can try to run the client and report back errors, did I get that right?

Regarding the building of the VM image: This is just a very simple VM with KDE under Wayland with synology drive client installed. You can try starting the client there. For me this was working as expected.

ailelix commented 5 months ago

@ailelix when trying to open your dotfiles I get a 404 error, maybe the repo is private?

Sorry that I missed the github emails and temporarily closed that repo due to flake git issues However, I didn't find the .SynologyDrive under my home dir, even after launching the Drive App

Here's my nix config for GTK and QT under Home Manager:

{ pkgs, ... }:
{
  # Set GTK Theme
  gtk = {
    enable = true;
    theme = {
      package = pkgs.graphite-gtk-theme;
      name = "Graphite-Dark";
    };
    iconTheme = {
      package = pkgs.tela-icon-theme;
      name = "Tela-manjaro-dark";
    };
    font = {
      name = "Noto Sans";
      size = 11;
    };
    # Declare dark mode and fcitx5 to gtk apps
    # Set IM in gtk config instead of env, see:
    # https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
    gtk2.extraConfig = "gtk-im-module=\"fcitx\"";
    gtk3.extraConfig = {
      gtk-application-prefer-dark-theme = 1;
      gtk-im-module = "fcitx";
    };
    gtk4.extraConfig = {
      gtk-application-prefer-dark-theme = 1;
      gtk-im-module = "fcitx";
    };
  };
  # Set QT Theme
  qt = {
    enable = true;
    platformTheme.name = "gtk";
    style = {
      name = "adwaita-dark";
      package = pkgs.adwaita-qt;
    };
  };
}

And I have these environment variables set in hyprland: ( HomeManager, wayland.windowManager.hyprland.env )

env = [
  # Toolkit Backend Variables
  "GDK_BACKEND, wayland"
  "SDL_VIDEODRIVER, wayland"
  "CLUTTER_BACKEND, wayland"
  # XDG Specifications
  "XDG_CURRENT_DESKTOP, Hyprland"
  "XDG_SESSION_TYPE, wayland"
  "XDG_SESSION_DESKTOP, Hyprland"
  # QT Variables
  "QT_AUTO_SCREEN_SCALE_FACTOR, 1"
  "QT_QPA_PLATFORM, wayland"
  "QT_WAYLAND_DISABLE_WINDOWDECORATION, 1"
];
michelealbrigo commented 5 months ago

Ah, that makes sense. I will try to work further on this in the coming days. It's just that I have some midterm exams coming up and have a lot to do for my Bachelor's thesis at the moment :(. Is the deletion of the directory a hack that works for now though?

Yes, deleting the directory works fine for me, I'll try to test the build today. Thank you!

MoritzBoehme commented 5 months ago

Sorry that I missed the github emails and temporarily closed that repo due to flake git issues However, I didn't find the .SynologyDrive under my home dir, even after launching the Drive App

Mhh, strange. I'll try to add your config as another VM image, to test it out.

gitmeED331 commented 1 week ago

I am having the same issue:

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.qpa.plugin: Could not find the Qt platform plugin " xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

I have Qt6 and Qt5compat installed

and I have QT_QPA_PLATFORM = "wayland; xcb"; set