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

Screen Identifiers #79

Closed
arciisine opened this issue Mar 7, 2016 · 11 comments
Closed

Screen Identifiers #79

arciisine opened this issue Mar 7, 2016 · 11 comments
Assignees
Milestone

Comments

@arciisine
Copy link

Right now, the only I can find to identify screens is by dimension. It would be great to be able to get a device identifier, especially when you have multiple monitor setups with the same resolutions.

@kasper
Copy link
Owner

kasper commented Mar 7, 2016

@timothysoehnlin Hi! Screens implement the Identifiable-interface. You can use the value returned by the hash-function as an identifier. Would this work for you?

@kasper kasper added the question label Mar 7, 2016
@kasper kasper self-assigned this Mar 7, 2016
@arciisine
Copy link
Author

Hmm, that sounds possible, but my concern is, if that is a consistent identifier across restarts/monitor plugin/unplug (different ports) etc. Plus, I would like to be able to enumerate the displays and provide feedback to the user to what screens are what.

Ultimately I'm building a window manager built on phoenix, and I need to map applications to specific screens. I can foresee a time where the user is building their config visually but will need to be able to identify the screens to indicate where applications/windows should go.

@kasper
Copy link
Owner

kasper commented Mar 7, 2016

Good question. You can certainly try and see if it’s consistent over those cases. We can also make the UUID for the screens accessible through the API.

@kasper kasper added this to the 2.1 milestone Mar 7, 2016
@arciisine
Copy link
Author

I will take a look at the hash and see what it provides, but I'm assuming
unless its the same as the UUID it won't be as useful to me.

On Mon, Mar 7, 2016 at 10:14 AM, Kasper Hirvikoski <notifications@github.com

wrote:

Good question. You can certainly try and see if it is consistent over
those cases. We can also make the UUID for the screens accessible through
the API.


Reply to this email directly or view it on GitHub
#79 (comment).

@kasper
Copy link
Owner

kasper commented Mar 7, 2016

@timothysoehnlin It’s definitely not identical to an UUID, but it’s hard to know how the hash value is evaluated. Let me know what you find out.

@arciisine
Copy link
Author

Will do, thanks!

@arciisine
Copy link
Author

Okay, so I was able to get round to checking this, and it seems the Screen ID is consistent across reboots/ and the Phoenix app restart.

So it should suffice, but that would just mean that I need to enumerate the displays and associate with the hashes. Going back to the original intent, I'm thinking it would still be nice to have this provided by the framework to create a common platform for building multi window management.

Not sure if it helps, but this is the output I'm trying to work with: https://github.com/timothysoehnlin/PhoenixLayout/blob/master/src/config.ts

Ultimately I want to provide a more reasonable way to identify screens by hand. Though if/when I get around to building the UI for this, that would be mitigated pretty heavily.

@arciisine
Copy link
Author

Spoke too soon. I've been having the event "screensDidChange" fire seemingly at random, but I finally diagnosed it. It appears to be tied to the switch between integrated and dedicated graphics on my MBP. This means that the screen hash() is not sufficient for identify displays.

@kasper
Copy link
Owner

kasper commented Mar 13, 2016

@timothysoehnlin OS X will fire that event not only when attaching or detaching displays, but also when their options are changed. Changing the graphics card would most likely go under this. I think it’s reasonable to add UUID-support for screens to the API. I’ll sort this out soon.

@arciisine
Copy link
Author

Awesome. Thanks so much. Looking forward to it.

@kasper
Copy link
Owner

kasper commented Mar 23, 2016

@timothysoehnlin This has now been implemented in master and will be released in 2.1. See identifier() in Screen for accessing the UUID.

@kasper kasper closed this as completed Mar 23, 2016
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

2 participants