SpacingBat3 / WebCord

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

Screenshare window instead of whole screen #409

Closed CorneliusCornbread closed 11 months ago

CorneliusCornbread commented 1 year ago

Is your feature request related to a problem? Please describe. A similar application, discord-screenaudio has the ability to screen share windows and desktops

Describe the solution you'd like discord-screenaudio image

webcord image

Describe alternatives you've considered There is no alternative, I want to screenshare a window and a window only

SpacingBat3 commented 1 year ago

Well, that sounds like a yet another problem with Electron – it doesn't really support screen share portals in its API and there isn't much of the ways to configure what's triggered. I guess it also depends on portal implementation – I believe GNOME portals were able to screenshare both windows and entire screen.

I also use a workaround for screenshare for some time, as I dunno if it were fixed on Electron's side. This could cause some issues like that in the future as previously desktopCapturer.getSources API would generate the required source data. This data is now being hard-coded using the values previous versions of Electron would return as the API was cause of crashes on Wayland before.

theofficialgman commented 1 year ago

@SpacingBat3 just an fyi, all the screenshare wayland fixes have landed in electron 26 so when the first stable release of that comes out on 2023-Aug-15 then it will be time to update to it https://github.com/electron/electron/pull/39111 https://github.com/electron/electron/pull/38833

theofficialgman commented 1 year ago

@SpacingBat3 with electron 26, this workaround should probably be removed unless I am missing something https://github.com/SpacingBat3/WebCord/commit/f26e95bf17281d82a25bee82a4805136bd3f042b

SpacingBat3 commented 1 year ago

Yeah, I'll do it once I'll have a chance to try it out... I'll probably set up a VM for that…

theofficialgman commented 11 months ago

not fixed. pops up a second time after clicking the share button in the portal

happens on armcord too so seems to me either you both have the same bug or its a general electron issue....

SpacingBat3 commented 11 months ago

(...) pops up a second time after clicking the share button in the portal (...)

You mean the app behaves differently on 2nd click?

Take a note this bug is for missing section for recording windows. I think I did all I could in Electron to setup this, maybe I'll have to take a look if there are any additional sources created when I've added "window" to types, or add some logic to show a picker on Wayland when there's >1 sources in the array, allow the user to choose them instead of the default choice.

theofficialgman commented 11 months ago

You mean the app behaves differently on 2nd click?

yes, on first click the share window closes and then immediately opens again. on click of the share button in the new window it actually shares.

SpacingBat3 commented 11 months ago

You mean the app behaves differently on 2nd click?

yes, on first click the share window closes and then immediately opens again. on click of the share button in the new window it actually shares.

@theofficialgman Oh, so that's actually different issue, I dunno if that was actually reported before or existed before v4.5.0. What about sharing the window contents, is that possible or not on Wayland? Anything changed within that?

theofficialgman commented 11 months ago

@theofficialgman Oh, so that's actually different issue, I dunno if that was actually reported before or existed before v4.5.0. What about sharing the window contents, is that possible or not on Wayland? Anything changed within that?

sharing window contents and fullscreen work. they just prompt the second popup

SpacingBat3 commented 11 months ago

@theofficialgman That's definitely a different issue, I suppose then I'll close this issue ticket. If you want to create a more organised bug report for the issue you were describing, you might open another ticket for that.