SpacingBat3 / WebCord

A Discord and SpaceBar :electron:-based client implemented without Discord API.
MIT License
1.88k stars 93 forks source link

Can't drop files into WebCord #464

Open neondeex opened 11 months ago

neondeex commented 11 months ago

Acknowledgements

Operating System / Platform

🐧️ Linux

Operating system architecture

x64 (64-bit Intel/AMD)

Electron version

25.6.0

Application version

4.4.0

Bug description

I can't drop files into any chat

Additional context

No response

SpacingBat3 commented 11 months ago

Most likely a duplicate of #371, #435, and #459, unless you have original CSP settings (i.e. everything toggled on).

neondeex commented 11 months ago

I have all in default and i can upload media but i can't drag and drop anything

crabreader commented 11 months ago

Can confirm that I also have this issue, some UI elements become unresponsive when I try to drag and drop files into a chat (cant switch channels, cant type in the chatbar). If switch server it resets and becomes responsive again.

SpacingBat3 commented 11 months ago

Cannot reproduce it on my end though, at least on Electron 26… What packaging method are you using @neondeex? Also @crabreader are you on the same major version of Electron (i.e. 25) or different?

neondeex commented 11 months ago

I use the AUR version

SpacingBat3 commented 11 months ago

@neondeex Also, are you on Wayland, XWayland or X11?

SpacingBat3 commented 11 months ago

I use the AUR version

I've tested the build (webcord) from chaotic-aur, things are OK with that… Also, did you double-checked that Google Storage isn't being disabled for sure in WebCord's settings?

crabreader commented 11 months ago

I use electron from the arch extra repository, it seems to be version 25. When I tried to install electron 26 I was unable to make webcord run using that version, I don't know how to build webcord with a specific version of electron.

Also it might be of note that I am using wayland with a nvidia graphics card.

crabreader commented 11 months ago

My issue appears to be related to xwayland, I managed to build webcord with electron26 but I didnt realize that it runs under xwayland. I get an error like this when I attempt to drag a file:

[82368:0912/175748.813949:ERROR:x11_drag_context.cc(150)] XConvertSelection failed for source-advertised target 540

SpacingBat3 commented 10 months ago

My issue appears to be related to xwayland, (...)

@crabreader What about running app in Wayland (--ozone-platform-hint=auto or --ozone-platform=wayland)?

crabreader commented 10 months ago

@SpacingBat3 Can confirm that it works when i run webcord with that flag, but I also need to use --disable-gpu for it to launch. I don't know if that can lead into other problems.

dreamsyntax commented 10 months ago

I can reproduce this on X11 using the Flatpak. Using the + button and manually picking the file instead of drag&drop works fine.

SpacingBat3 commented 10 months ago

I can reproduce this on X11 using the Flatpak. Using the + button and manually picking the file instead of drag&drop works fine.

@dreamsyntax That one is actually a problem specific to Flatpaks (or Electron, if there's any app actually functional with drag&drop packaged as Flatpak?) since there's sandboxing going on and it is very likely that drag and drop doesn't work via portals like when adding a file via native dialogs.

lambdcalculus commented 9 months ago

I have been having this problem as well. However, I have this issue using Discord (Arch-packaged) Chromium as well. So it might be a Chromium bug. I'm not sure it is a problem with WebCord, as it happens in default Discord as well.

For reference, I am using a wlroots compositor, specifically Hyprland. It would be interesting to see if the issue is related to that.

edit: for extra confirmation, Discord website in Firefox does not have this issue.

SpacingBat3 commented 9 months ago

(…) I'm not sure it is a problem with WebCord, as it happens in default Discord as well.

It definitely isn't. But I'll track it here. I doubt I can do anything to fix it, it sounds to be highly specific to Wayland and given I don't use a Wayland-based DE nor Chromium is supporting it as a stable, it is unlikely I'll came with some workaround. Possibly reporting this to upstream (i.e. to Chromium or Electron devs) is what should be done.

lambdcalculus commented 9 months ago

Oh, just confirmed that --ozone-platform=wayland works for me on both Discord and WebCord, along with Discord in Chromium. I thought I had already done it before, but actually hadn't done it properly: kill all Discord/Webcord/Electron instances before relaunching, otherwise it will run on Xwayland which seems to be the cause of the broken drag-and-drop. Make sure the window does not open as Xwayland and it should work fine.