Nitrokey / nitrokey-app

Nitrokey's Application (Win, Linux, Mac)
https://www.nitrokey.com/
287 stars 55 forks source link

Graphic glitches on Fedora 31 Wayland #431

Open glasl opened 4 years ago

glasl commented 4 years ago

Environment

Expected behaviour

When moving the window on the desktop and pressing 'menu' in the titlebar menu, drop down menu opens placed right inside the app menu.

Current behaviour

When moving the window on the desktop and pressing 'menu' in the titlebar menu, drop down menu opens placed outside the nitrokey app where the window was moved from.

Steps for reproduction

open app, drag to another place on the desktop, click the 'menu' drop down menu in the titlebar (in case bug doesn't appear, repeat several times).

Preconditions

none

Steps

  1. start wayland session
  2. open nitrokey-app
  3. click 'menu' drop down title bar menu
  4. repeat 3. until erratic behaviour appears

Logs attached:

szszszsz commented 4 years ago

Hi! Could you retest this issue as well with https://github.com/Nitrokey/nitrokey-app/issues/432#issuecomment-549311218 ?

glasl commented 4 years ago

Retested:

In both cases the app would not detect the Nitrokey Pro v2 despite ending all related processes.

szszszsz commented 4 years ago

Thank you for retesting! That should give some hints to package maintainers - I plan to link this ticket to report.

About lack of the device detection, sounds like Udev rules are not present. Have you removed the OS distributed nitrokey-app package, while testing AppImage/Flatpak?

@enleth Could you link to the latest AppImage / Flatpak build?

glasl commented 4 years ago

I tested the AppImage and Flatpak packages after 'dnf removing nitrokey-app'.

szszszsz commented 4 years ago

I see. You do not need to remove the package, unless it bothers you (disk space, menu shortcut etc.). It contains the Udev rules, which you need to install manually otherwise AFAIK (nothing hard - just a copy of the Udev rule from the repository to proper system directory), since the AppImage/Flatpak package cannot control that.

@enleth BTW any idea, how to insert Udev rules into mentioned?

quiescentnexus commented 4 years ago

@enleth BTW any idea, how to insert Udev rules into mentioned?

AppImage can do pre-sandbox wrapper scripts and some developers seem to be using those to invoke a script through sudo that would "install" the udev rules, such as: https://github.com/EspoTek/Labrador/issues/22#issuecomment-364594369 https://github.com/JvanKatwijk/qt-dab/issues/34#issuecomment-289270761

Maybe there is a way to do this that doesn't look really scary and hacky, not sure. First things first, something like that probably shouldn't add unmanaged files to /etc/. Instead, /run/udev/rules.d/ could be used - this seems to be a little known feature of udev despite being mentioned in the literally first sentence of the "RULES FILES" section of udev(7). Still requires root access, though, and is arguably even worse from the UX point of view - instead of asking for root once and leaving a mess in /etc/udev/rules.d/, the app requests root access after every system reboot because /run/udev/rules.d/ is volatile.

Flatpak doesn't even have that. Not even Valve managed to get around this for Flatpak version of Steam and the Steam Controller: https://github.com/flathub/flathub/issues/278 https://github.com/flathub/com.valvesoftware.Steam/issues/8

In effect, both work nice as a quick upgrade path for when your distro does include nitrokey-app but doesn't update it fast enough - so you can keep the distribution package installed for the udev rules but actually use the AppImage or Flatpak version. Otherwise it's horrible hacks, or manual changes to udev rules, or nothing. Honestly, I can't think of a proper way out at the moment.

szszszsz commented 4 years ago

Let's move the discussion about the Udev rules packaging to #435.

@glasl Unfortunately, for AppImage / Flatpak you need to either install system package, or install the Udev rules by hand.

About the Wayland issues, I will report the problems and link the ticket here once done. My hunch is, that this is a general problem, since Wayland is still in active development, and all Qt-based applications have probably similar glitches. If you would encounter any information that might help, feel free to post it here.