-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use output/display names for wlgrab #2885
base: master
Are you sure you want to change the base?
Conversation
Are there any comments or feedback on this PR? |
I haven't even looked at it since it was marked draft. |
Fair enough :) It's marked a draft because it doesn't include the necessary documentation effort, as before putting that effort in I would like some general feedback on the idea. Is the project interested in the feature? Is my proposed implementation strategy ok? Etc |
I think this is an improvement overall, but I say this as a non Linux user. Also, any help on the Linux side is greatly appreciated. Most of the active devs are mostly focused on Windows. This may affect #2490 |
Good catch. The main improvement of #2490 is to add a "friendly name" to the screen, in addition to an ID, and the relevant UI changes. However, it does not change how ids are computed. My PR, instead, does change how IDs are picked: the actual Wayland IDs can now be used instead of the made-up Sunshine IDs (while retaining the ability to recognize them). This is also the case for the macOS implementation, even though unfortunately the native IDs are not as user-friendly as the ones on Linux/Wayland. While I do not have the chance to perform testing on macOS, I can assume that the IDs are stable across applications and perhaps reboots, Thus, this does to some degree interact with #2490, which perhaps should be merged first, and then this PR should be reworked to build upon the respective modified data structures to reimplement this functionality. Similar work could probably be carried out for other platforms, as I think this is in principle very useful and makes configuring Sunshine more intuitive and stable. To abstract a bit, I think the interaction between these two PRs underlines the following design directions:
I would be willing to contribute more work towards both the above directions, particularly on Linux (and perhaps Windows if no one else is interested in picking this up), if deemed worthwhile. However, I think that such structural decisions require a broader discussion and much more feedback. Is this the appropriate place to have such a discussion, or should I post this somewhere else? |
Yes. There's also this for Windows: #2894 which uses https://github.com/LizardByte/libdisplaydevice ... currently that library is Windows only, but it could be extended to macOS and Linux as well. Linux probably being the more difficult one due to so many options... not saying this work needs to move to that library (but you can contribute there if you want), just pointing out that we are moving to more stable IDs for Windows as well. e.g.
I'm not sure on that. It sounds like it would be complex and probably break easily. I think moving to a more stable ID is sufficient for now. This has also been one of the longest standing issues with xorg: #221 |
Description
TL;DR: This is a proof-of-concept PR for supporting using output names with the Wayland grabber, instead of arbitrarily-generated numeric ID as it is currently the standard in Sunshine.
Long version:
Currently, output IDs are assigned following this logic:
Sunshine/src/platform/linux/wlgrab.cpp
Line 39 in eafb472
Sunshine/src/platform/linux/wayland.cpp
Line 175 in 1dd4b68
std::vector
, implicitly assigning them numeric IDs in whatever order the Wayland server enumerates the objectsThis is nondeterministic in two different ways:
This commit introduces support for indicating a
wl_output
/zxdg_output_v1
output name (e.g.eDP-1
,HDMI-0
for wlroots based compositors) in theoutput_name
Sunshine parameter. I think this improves the above situation in the following ways:Please note that this PR is a proof of concept, mainly to kickstart a conversation on the feature. If the feature is deemed desirable, before merging it, some improvements that can be made to this PR are:
Screenshot
(not relevant)
Issues Fixed or Closed
This is somewhat related to #2490.
Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.