-
Notifications
You must be signed in to change notification settings - Fork 0
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
ui.windows() is not Z ordered on Windows #147
Comments
the window class doesn't seem to have height and y properties at all at least on my version; does it have a .rect property? |
Hmmm, maybe it's a deprecated API? I assumed it was present from knausj85's code, here: https://github.com/knausj85/knausj_talon/blob/dcbb1ea89fd1bfbd09f57c25d9dc8a8907270c42/code/mouse.py#L239 It doesn't look like there is a rect property either. This is currently a blocker for creating nice gaze scrolling I'm presuming this is because the eyetracking API is not public yet and is undergoing frequent change. I'll try to set up proper IntelliSense and see what is available |
I think Talon's working fine I think you're slightly misreading the code here due to questionable variable naming. "window" in the referenced script is actually the rect. The function looks for the first window that contains mouse coordinate. This should perhaps just use ui.active_window() instead. if you do something like this, you will see all dimensions and positions for windows. |
is this not actually a bug? |
As far as I can tell, the window sizing information is correct on Windows 10. I believe the actual issue is that the window list isn't Z-sorted, as on Mac and Linux. I've poked around for an API that will allow us to do so, but they all feature ominous warnings. e.g., https://stackoverflow.com/questions/6381198/get-window-z-order-with-python-windows-extensions suggests:
but this just calls GetWindow, which has some (albeit obvious) caveats:
People claim EnumWindows / EnumChildWindows z-orders things, but its not actually documented and probably not guaranteed. throws hands in air |
Is a valid janky solution just to sort the topmost window to the front and ignore ordering the rest for now? |
Hmm, maybe. I'd be willing to test around it for you. |
What does your code need the window order for? |
It's used for the rudimentary "gaze" scrolling with control mouse. Scrolls based on the cursor distance vs midpoint of the window that contains the cursor. |
Why not only consider active_window as a workaround?
|
It's on my list to look at active_window first to improve it - or maybe exclusively on Windows for now, but that's a little less convenient. Since scrolling is allowed without a window having focus on Windows and Mac, it's not 'ideal' to consider just active_window, long-term, imo. I take advantage of this behavior often. |
https://stackoverflow.com/q/295996
|
Fixed in 0.1.5-452 |
windows = ui.windows()
seems brokenProperties attached to window object are not correct.
e.g:
window.height
andwindow.y
for specific windows all return the same resultHope this help
OS: Windows 10
The text was updated successfully, but these errors were encountered: