Vencord / Vesktop

Vesktop is a custom Discord App aiming to give you better performance and improve linux support
GNU General Public License v3.0
3.77k stars 180 forks source link

[Linux] Ozone platform hint #342

Open NyaomiDEV opened 8 months ago

NyaomiDEV commented 8 months ago

Is your feature request related to a problem? Please describe. This solves a problem with consistency on Wayland desktops.

Describe the solution you'd like The .desktop file could have --ozone-platform-hint=auto appended to it. It would be possible to pass it straight from the app's code via app.commandLine.appendSwitch('ozone-platform-hint', 'auto') but I couldn't get it to ever work in my Electron test thingamajigs.

Describe alternatives you've considered XWayland... uhhhhh.... not in my desktop sorry.

Additional context :sparkles: Fractional scaling! :sparkles:

ToxicMushroom commented 8 months ago

This breaks drag and drop completely on my system arch, sway, nemo file manager

Sqaaakoi commented 8 months ago

This breaks drag and drop completely on my system arch, sway, nemo file manager

iirc nemo runs through XWayland

NyaomiDEV commented 8 months ago

This breaks drag and drop completely on my system arch, sway, nemo file manager

you should see if drag and drop is working correctly between nemo (xwayland) and any other native wayland client. if that's not the case, you'd need to debug that on your own.

here, running KDE on Wayland, drag and drop correctly works.

ToxicMushroom commented 8 months ago

iirc nemo runs through XWayland

Not for me (using nemo 6.0.2-1 from arch extra)

Drag and drop works to other wayland native apps like gnome's ghex

NyaomiDEV commented 8 months ago

Not for me (using nemo 6.0.2-1 from arch extra)

Drag and drop works to other wayland native apps like gnome's ghex

are you totally sure? what does xlsclients show you?

also do you have vesktop installed as a flatpak?

ToxicMushroom commented 8 months ago

Ye I'm sure xlsclients doesn't list them, xprop doesn't show a cross and app_ids are present in sway.

No I dont use the flatpak because of this drag and drop (dnd) issue since they also start the client with ozone (just checked again to make sure it didnt get fixed in the meantime). I run the vesktop aur package under xwayland most of the time since then dnd then works 50% of the time.

NyaomiDEV commented 8 months ago

Ye I'm sure xlsclients doesn't list them, xprop doesn't show a cross and app_ids are present in sway.

No I dont use the flatpak because of this drag and drop (dnd) issue since they also start the client with ozone (just checked again to make sure it didnt get fixed in the meantime). I run the vesktop aur package under xwayland most of the time since then dnd then works 50% of the time.

it seems to me that your sway configuration is to be checked.

ToxicMushroom commented 8 months ago

The only thing that affects dnd I think is focus_follows_mouse, turning it on breaks dnd 100% on discord/vesktop running in xwayland while not fixing either (nor the flatpak) on ozone.

Maybe unrelated since I don't know how much different their client works but dnd to discord-screenaudio always works (the run wayland native according to xprop, xlsclients ect).

https://0x0.st/H00j.txt

NyaomiDEV commented 8 months ago

If you feel it doesn't work for you in native Wayland you can use XWayland for now - however, even if this feature gets added, you can still remove the argument yourself until you fix whatever is wrong with your setup.

Maybe unrelated since I don't know how much different their client works but dnd to discord-screenaudio always works (the run wayland native according to xprop, xlsclients ect).

Screenaudio uses webkitgtk, while Vesktop uses Electron (same as Discord.)

https://0x0.st/H00j.txt

I can't tell you what's wrong with your setup, as I never used sway. Please do your own research about it. I think, however, that this feature request should move on to reach parity with the Flatpak package and also because of other issues that it would solve (for example again, proper fractional scaling support)

Vendicated commented 8 months ago

No I dont use the flatpak because of this drag and drop (dnd) issue since they also start the client with ozone (just checked again to make sure it didnt get fixed in the meantime).

@ToxicMushroom you can just remove the wayland permission from the flatpak and it'll run in xwayland. for example using flatseal

ToxicMushroom commented 8 months ago

It seems to be a chromium issue, I'll see if I can fix it but no promises, it's misusing the wlr_data_device protocol from what I can tell. Idk whose fault it is anymore xd

AAGaming00 commented 8 months ago

This should be an (on by default IMO) setting, as on some systems it is helpful while on others it causes issues (like on my dual-gpu laptop where running directly under wayland causes it to keep the dedicated GPU awake)

ToxicMushroom commented 7 months ago

This is now fine for me since https://github.com/linuxmint/nemo/issues/3354 was resolved :)

Schweeeeeeeeeeeeeeee commented 7 months ago

I don't know why, but I can't get vesktop to launch on hyprland and I think this is why would be pretty useful

dumbasPL commented 7 months ago

After a recent update (not sure if system or vesktop) the main window became completely transparent, adding --ozone-platform-hint=auto fixed it.

Arch Linux, Gnome 45.4 on Wayland, Nvidia 545.29.06, vesktop 1.5.0 from AUR vesktop-bin

catgirlcataclysm commented 4 months ago

I'm also having the drag and drop issue on the newest flatpak (1.5.2), running KDE wayland. After I drag a file into the app, everything works properly until I send the message, in which the app instantly stops responding to any mouse input, but the keyboard works fine. I assume this is due to it running in xwayland, but I am not sure.

mystchonky commented 3 months ago

I'm also having the drag and drop issue on the newest flatpak (1.5.2), running KDE wayland. After I drag a file into the app, everything works properly until I send the message, in which the app instantly stops responding to any mouse input, but the keyboard works fine. I assume this is due to it running in xwayland, but I am not sure.

I can also replicate this issue. It works well when using the '+' button in the message box but drag and drop breaks the application. Need to restart the app.

mystchonky commented 3 months ago

Could it be this issue ? https://bugs.kde.org/show_bug.cgi?id=482142. This was fixed already and going to be released in plasma 6.1

ShayBox commented 3 months ago

I also had to spend hours figuring out this is a Vesktop/Electron issue, and found this issue. This should really be enabled by default, because it doesn't negatively affect anyone still using X11. There's also --use-gl=desktop which opens the window immediately, instead of after around a minute.

Vendicated commented 3 months ago

This should really be enabled by default, because it doesn't negatively affect anyone still using X11

false. there's a reason this is still not enabled by default in chromium. Just because it is stable for you doesn't mean it is stable for everyone. also there's really no solid way to enable this from our side, since this is a command line switch you need to pass. how are we supposed to pass a flag to our own executable? it is up to packagers to do this

in any case, we already enable this by default inside the flatpak

mystchonky commented 3 months ago

Could it be this issue ? https://bugs.kde.org/show_bug.cgi?id=482142. This was fixed already and going to be released in plasma 6.1

I got plasma 6.1 but the issue still persists. I will go talk to plasma kwin devs and see what's going on. Does Vencord handle any special cases for drag and drop that the devs will need to know about to fix this ?