Code Monkey home page Code Monkey logo

Comments (6)

jigish avatar jigish commented on July 16, 2024

Good call. Unfortunately the screen IDs apple uses are ordered in the following order:

0 = always main screen (the screen with the menu bar)
after that, they are ordered in the order in which they were plugged in.

I'll try to add a config option that will make the screen IDs go from left to right, and map them internally to the screen IDs that apple uses.

from slate.

jigish avatar jigish commented on July 16, 2024

Ah -- just thought of something interesting. Screens are also allowed to be above/below. I'll make it so it starts at 0 at the top-left screen and fills in this order:

0  1  2  3
4  5  6  7

from slate.

philc avatar philc commented on July 16, 2024

Yes, that would be great. In case the API doesn't give you that information, you could of course determine a screen's position from the bounding rect of each nsscreen in relation to the others.

from slate.

philc avatar philc commented on July 16, 2024

This kicks my butt every day -- sending a window to screen #N is not reliable as those numbers are always changing around.

from slate.

jigish avatar jigish commented on July 16, 2024

Finally got to this in 0.4.9. Sorry, real life gets to me when the dancing season starts.

Here is how it works:

Default (no work on your part): screens are ordered from left to right (by the top-left origin X coordinate, falling back on Y coordinate if they are the same). This means they are not ordered as I listed in my above comment.

If you want to use the old style ordering, you can set the config "orderScreensLeftToRight" to false. By setting this to false, the default handling of screen IDs remains how it was in 0.4.8, but you can also use the "ordered:" prefix to the screen ID to make it work for that particular binding as if "orderScreensLeftToRight" was true.

from slate.

philc avatar philc commented on July 16, 2024

Just tried it and it works great. Thanks again!

from slate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.