Skip to content
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

Screenname #11512

Closed
Lure5134 opened this issue May 24, 2023 · 4 comments
Closed

Screenname #11512

Lure5134 opened this issue May 24, 2023 · 4 comments

Comments

@Lure5134
Copy link
Contributor

Is it possible to add the monitor name to the screen class?
This would be useful for example for a presentation application where the user should be able to select a monitor where the presentation should start.
Currently the screen class has no name or Id or something like that.

@maxkatz6
Copy link
Member

It would be an excellent addition, but somebody needs to research if this information is available on Linux and macOS API.

@thevortexcloud
Copy link
Contributor

thevortexcloud commented May 24, 2023

On all OSes you should just be able to read the EDID info (on Linux this generally involves reading a file from sysfs and then decoding it so no special native API calls should be needed) as the EDID is actually built into the monitor. Although depending on what you mean by "name" can be much tricker. On Linux getting the name of the port's that are connected is fairly straight forward and does not require parsing EDID info. EG querying cat /sys/class/drm/card0/card0-{PORTNAME}/status/ will tell you if something is plugged into a specific port on a specific GPU (in this case card0).

If you want the actual brand name of the monitor then you need to parse the EDID.

https://en.wikipedia.org/wiki/Extended_Display_Identification_Data

As for Mac, I can't say much about how they do things.

If someone does decide to implement this based on the EDID name, my question would be how would you differentiate identical model monitors in a way that the user would understand? Generally on Linux/Windows this is done by just assigning a number to each of the monitors. Would that be an application or Avalonia concern?

@thevortexcloud
Copy link
Contributor

Actually, looks like the DrmFramebuffer for Avalonia already includes all the functionality needed to parse port names and goes direct via libdrm. I am guessing someone could just integrate that functionality into the main project if that was the path people agreed to.

@maxkatz6 maxkatz6 mentioned this issue Jun 3, 2024
3 tasks
@maxkatz6 maxkatz6 mentioned this issue Jul 12, 2024
3 tasks
@maxkatz6
Copy link
Member

maxkatz6 commented Aug 2, 2024

Completed in 11.2 nightly. Mobile support is coming later.

@maxkatz6 maxkatz6 closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants