input-output-hk / daedalus

The open source cryptocurrency wallet for ada, built to grow with the community
https://daedaluswallet.io/
Apache License 2.0
1.23k stars 297 forks source link

Flickering when running on XWayland #3157

Closed fajard01 closed 5 months ago

fajard01 commented 6 months ago

There has been an update for KDE systems to Plasma 6 which now defaults to the Wayland display protocol. However it seems Daedalus is not able to run yet on native Wayland but continues to use the XWayland compositor. The problem is using XWayland causes a lot of flickering in the interface. It would be good to have full support for Wayland.

michalrus commented 6 months ago

@danielmain I think updating Electron will help here?

danielmain commented 6 months ago

I have been using Daedalus on sway (wayland) and never saw this flickering.

Plasma 6 is too new and buggy, you can read it everywhere https://news.ycombinator.com/item?id=39548088

@fajard01 can you downgrade to Plasma 5 please 🙏🏻 or wait until Plasma 6 is more stable? On gnome and sway on wayland this issue does not exist.

fajard01 commented 6 months ago

@danielmain you might be running on wayland but I have a feeling when you run Daedalus it's the xorg-wayland compositor that kicks in for it. Also another reason for the flickering is that I'm on a HiDPI display. My request is actually to have an implementation fully for the Wayland protocol and michalrus is probably right that an Electron update might be the way forward. I am running on Archlinux and I don't really want to downgrade my Plasma just for Daedalus. I can live with the flickering and it might also be good to check the Electron-Wayland compatibility issue and yes, Plasma 6 might still have issues with Electron.

danielmain commented 6 months ago

@fajard01 I am also using a 4k monitor with higher dpi 😊 and no flickering so far.

Checking the release notes Electron 12 added wayland support. Daedaulus at this right moment is using electron version 24 https://github.com/input-output-hk/daedalus/blob/23976ef3503bb9602bd70ef88a25b4b9ddc47401/package.json#L222

We are about to release a new Daedalus soon with electron version 27, maybe it solves your issue 🤔.

fajard01 commented 6 months ago

@danielmain Thanks for your reply. My issue stems from the fact that in my system, I can't get Daedalus on native Wayland. When I run Daedalus and check which manages the window with: qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole It shows it's using the X11 window.

The flickering could also be related to Nvidia. Are you by any chance using an Nvidia GPU?

I'll see if I can find a solution for Electron24 and hopefully the next update will sort everything out.

Thanks again.

danielmain commented 6 months ago

Nope I have AMD, unfortunately Nvidia and Wayland have a complicated relationship 😂 but I have another machine with Linux and Nvidia using proprietary drivers (currently with i3 x11). So when I have some time, I can try it out :)

@fajard01 I have a working branch with Electron 27 here: origin/chore/LW-9860-upgrade-vulnerability-packages could you try it out now?

fajard01 commented 6 months ago

@danielmain I do have a bad feeling Nvidia is the culprit. The flickering doesn't happen all the time. It's only when I move the mouse for some UI that starts it and it usually stops when I click on other parts of the window.

Thanks for the link for Electron 27. I'll give it a go and report on my findings.

danielmain commented 6 months ago

Hi @fajard01 as promised I tested the current Daedalus 5.3.0 on Plasma/Wayland/Nvidia and I could not see the flickering Check this out: https://drive.google.com/file/d/1lntFIVFgQXfPqyuJo4OSxQ8KCA6MUFzt/view?usp=sharing

The only difference is maybe I am using the latest stable Plasma 5 version. Plasma 6 is not even available on NixOs unstable.

fajard01 commented 6 months ago

@danielmain Thanks for the update. I have a feeling this is an issue with Plasma 6 and electron. I have noticed other apps that uses electron like VS Code and Ledger Live have the same flickering when using the xorg-xwayland (XWayland). I shall investigate some more.

fajard01 commented 5 months ago

I've traced the issue to something called xorg-xwayland-explicit-sync and the issue it seems occur mostly with Nvidia GPU's. According to this archlinux forum thread https://bbs.archlinux.org/viewtopic.php?id=295433, the development version of xorg-xwayland includes this support. I tried it and installed the development version (https://aur.archlinux.org/packages/xorg-xwayland-git) and can confirm that fixes the issue. I can now close this issue.