I am not 100% sure if this is a bug, because I'm not sure of the intended behavior here.
I recently got a second monitor for my home office. With this, I discovered Rectangle doesn't order them quite the way I'd expect. My new screen layout is as follows:
This is the order I'd expect Rectangle to use when determining "next screen" (A->B->C->A). But it goes in the opposite order (C->B->A->C). From what I can tell, screen order is determined here:
|
func order(screens: [NSScreen]) -> [NSScreen] { |
|
let sortedByY = screens.sorted(by: { screen1, screen2 in |
|
return screen1.frame.origin.y < screen2.frame.origin.y |
|
}) |
|
let alsoSortedByX = sortedByY.sorted(by: { screen1, screen2 in |
|
return screen1.frame.origin.x < screen2.frame.origin.x |
|
}) |
|
return alsoSortedByX |
|
} |
If I'm reading the code and Apple documentation right (and bear with me, I've never used Swift or done Mac UI coding before), it orders screens by their X/Y origins (descending), prioritizing X-origin - which does indeed result in the actual screen order being calculated as C->B->A.
So I guess my question is, what's the intended behavior here? It seems more intuitive to me to go top-to-bottom, left-to-right (and, admittedly, this only really becomes an issue when you combine the two as I've done here.)
If this is the intended behavior - then would you accept a feature PR to override the default ordering?
I am not 100% sure if this is a bug, because I'm not sure of the intended behavior here.
I recently got a second monitor for my home office. With this, I discovered Rectangle doesn't order them quite the way I'd expect. My new screen layout is as follows:
This is the order I'd expect Rectangle to use when determining "next screen" (A->B->C->A). But it goes in the opposite order (C->B->A->C). From what I can tell, screen order is determined here:
Rectangle/Rectangle/ScreenDetection.swift
Lines 92 to 100 in 3700b65
If I'm reading the code and Apple documentation right (and bear with me, I've never used Swift or done Mac UI coding before), it orders screens by their X/Y origins (descending), prioritizing X-origin - which does indeed result in the actual screen order being calculated as C->B->A.
So I guess my question is, what's the intended behavior here? It seems more intuitive to me to go top-to-bottom, left-to-right (and, admittedly, this only really becomes an issue when you combine the two as I've done here.)
If this is the intended behavior - then would you accept a feature PR to override the default ordering?