-
Notifications
You must be signed in to change notification settings - Fork 120
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
Legion DPI fix #223
Legion DPI fix #223
Conversation
I don't have the hardware to properly test this (but it looks good on the surface), so I can't help with testing it. |
I also do not have multiple monitors however this works for my single Monitor with 150% scaling. You can try adjusting the display scaling slider yourself to see if this works. The boxes should be properly placed. |
caster/asynch/mouse/legion.py
Outdated
horizontal_dpi = windll.gdi32.GetDeviceCaps( | ||
dc, LOGPIXELSX) # Horizontal DPI determines the DPI scaling value | ||
windll.user32.ReleaseDC(0, dc) | ||
dpi_scaling = dpi_map[horizontal_dpi] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking about ways I could test this and that made me wonder if there is any software that could fake it on my current hardware. In order to keep the simulated resolution high enough to be usable it wouldn't necessarily scale at the same rates horizontally and vertically. It could also have weird DPI values.
What if a piece of hardware doesn't have square pixels? Also, wouldn't it be easier/faster to just divide the given DPI value by 96.0?
I have multiple monitors and will give this a try at work tomorrow. What I really wonder is whether this works on really high DPI screens, like they have on some laptops. I don't have anything like that to test with. |
I have access to a 4K screen and will test tomorrow afternoon |
I speak the Little bit of debugging |
There's a typo from autocomplete in the last change. I won't be home for about an hour to change it. I have added a comment in the code if you want to test it before I can change it. |
It looks like the problem is exacerbated on multiple monitors. At work I have a 1280x1024 and a pair of 1920x1080 monitors. If I set them all to 150%, and say "legion 3" (the rightmost monitor, labeled 2 in the screenshot), the legion grid is both too small and overlaps with monitor 1 in the middle. The good news is the legion rectangles are in the right places over the text. It looks like it's just a problem with the calculation of the screen capture rectangle and subsequent positioning of the Legion Grid window. Almost makes me wonder if we need to calculate anything or if just setting DPI awareness would be enough. |
@LexiconCode try signing out and back in, windows fails to update the dpi value without a reboot or sign out. If it works I will try to find a more reliable way to get the settings. |
I added the scaling to the x and y values as well. I think this Could fix @chilimangoes' problem of the screen overlapping. Do try to sign out and back in,after setting the scaling ,however else windows reports the previous dpi settings rendering the solution useless. |
Is it just the screenshots or is it still completely whack? |
Just the screenshots |
That completely fixed the problem as long as all three monitors have the same DPI scaling. However, when I set monitor 1 to 100% scaling and the other two monitors to 125%, the "Legion" command works fine on monitor one, but looks like this on the other two monitors. My guess is the problem is that the DC you're grabbing (NULL) is for the entire desktop. In order for the scaling to work properly, I imagine you'll need to get the DC for each monitor and calculate them separately. |
Note that fixing dragonfly would be more involved because it currently gets the monitor information on boot up and caches it in the exported |
We might hold off posting the issue in Danesprite's repository until I've had a chance to discuss this with him. |
We could always make the monitors variable a class with getters which would fetch the info on runtime. Or even add a new class.For Legion however to make the grid dpi aware an operating System check will be needed anyway. I don't think It's possible to make it completely cross-platform without dealing with each operating system's annoyances. |
That's a good idea. My Python is a bit rusty and it didn't even occur to me to use a class with an indexer property, or whatever Python calls them. |
I'll admit that the source code for it is available and public domain, but since we're talking about using a Windows DLL that isn't currently implemented on other platforms, isn't the whole discussion kind of academic at this point? Assuming this code is working for everyone and most people are satisfied with the box scaling code(though honestly I think it should be a setting in the configuration file), I think we should merge this as it is and separately work with Dane on fleshing out the cross-platform aspects of Dragonfly to better support this. |
Absolutely. My thought was to just give it another couple days to let the dust settle on these latest commits to see if there are any other issues before pulling the merge trigger. |
Sounds good. I'm usually a little too trigger-happy.
…On Fri, Apr 6, 2018 at 4:38 PM, Jacob Eggleston ***@***.***> wrote:
Absolutely. My thought was to just give it another couple days to let the
dust settle on these latest commits to see if there are any other issues
before pulling the merge trigger.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/synkarius/caster/pull/223#issuecomment-379411627>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALpedeHs3LXqrH1gq_fE5YLQ0gVpk-Fvks5tl_xngaJpZM4TCyXt>
.
|
Don't pull yet, I will put the option in the settings. |
Excellent, I'm a little like that with trigger-happy as well. |
@gerrish Danesprite is fine with issues and enhancements related to dragonfly being posted in his fork. |
I have restored the dependency on dragonfly and tested it with danesprite's update. It works well and should make it easier to implement a multiplatform solution in the future. |
A note for documentation. |
What is required to finally merge this pull request? Something like changing the way caster is installed to include the modified dragonfly? |
@gerrish we need to update the documentation to include Danesprite/dragonfly fork. Optionally update to include Danesprite/dragonfly dependencies |
Since the documentation currently uses videos to explain the installation process, how do you suggest we include the fork? Simply as a mention with a note to follow the instructions in the git hub page or a complete remake with full explanation? |
It's up to you although I'm leaning towards keeping it simple by including a note. The install procedure may change if we are able to use https://github.com/synkarius/caster/issues/217. |
…ed dragonfly_upgrade.bat to install the fork with its dependencies
It's done! |
Fix for issue #172,dpi settings properly accounted for.