ThePacielloGroup / CCAe

The Colour Contrast Analyser (CCA) helps you determine the legibility of text and the contrast of visual elements, such as graphical controls and visual indicators.
http://www.paciellogroup.com/resources/contrastanalyser/
GNU General Public License v3.0
479 stars 107 forks source link

Odd color picker behavior on Windows 10 when picking a color from an element displayed on an external monitor #54

Closed graemecoleman closed 4 years ago

graemecoleman commented 6 years ago

This may be out-of-scope (e.g. because the color picker is third party), but I've noticed an issue when trying to pick a color from an item displayed on an external monitor.

To illustrate, when I use the color picker on my laptop (Dell Inspiron 13 5000 Series) screen, the circle representing the circle is more or less in the same position as the mouse pointer.

image

However, if I try to pick a color on my external monitor, the mouse pointer and the circle are quite far apart. I can't take a screenshot pointing out where the mouse pointer is, so you'll have to take my word for it that is approximately where the white X is in the following screenshot:

image

Interestingly, the picker will still identify the color underneath the mouse pointer icon (rather than where the circle is) but I would be concerned that someone who may have difficulties identifying the mouse pointer may not spot this - and think that the color being picked up is where the circle element is (if that makes sense).

This is fairly low priority, but I thought I'd point it out.

patrickhlauke commented 6 years ago

i'm guessing this is a special case similar to https://github.com/ThePacielloGroup/CCAe/issues/17 - where your two displays aren't the same (one high-dpi, one normal-dpi)

graemecoleman commented 6 years ago

Yep, you're right, changing both monitor scales to be 150% resolves the issue (my external monitor was originally set to 100%, while my laptop screen was set to 150%).

Is it worth putting a note about this in the Help section, which appears when the question mark icon next to the color picker is activated?

ferllings commented 6 years ago

The ratio is calculated only when the picker opens. So we need to detect when the picker moves to a new monitor, then re-calculate the ratio

ferllings commented 6 years ago

Maybe I can use that:

https://stackoverflow.com/questions/28905420/window-devicepixelratio-change-listener

alastc commented 6 years ago

I also get this, so whilst in the last major version I had an issue with buttons (disappearing), now the primary display (at 250%) is fine, but the secondary display can only get about 2/5 across the screen.

So on the second display (at 100%), the picker starts in the bottom left, and if I move my mouse to the top right, will get almost to the middle of the screen.

ferllings commented 6 years ago

@alastc but if you open the picker in the 2nd screen it works fine, correct?

alastc commented 6 years ago

No, I:

The location of the picker is consistently about 2/5ths of the distance between the bottom left corner and the mouse location.

Note, my second display is a 34" widescreen at 100%, my primary display is a 15" 4k at 250%, so possibly the most extreme case you can get?!?

Also, it's windows, I don't get the same issue at work with my Macbook (200% main screen, 100% second display).

ferllings commented 6 years ago

Thanks. I'll try to replicate, but I don't have any Windows machine

alastc commented 6 years ago

If it is any consolation, most apps can't deal with this display setup, only browsers and MS Office seem to get it right. Most other Windows apps have the tiny/giant text & icons issues that the previous version did.

I'm happy to stick to my main screen, where the buttons are nice easy compared to the last version!

patrickhlauke commented 6 years ago

not sure how easy/hard/feasible it is, but: instead of checking the dpr once at [ed] picker invocation, should/can it be checked constantly when the picker is active/updated/moved? something like "the dpr of the window/screen currently under the mouse cursor"?

patrickhlauke commented 6 years ago

@graemecoleman @alastc made a naive first attempt at fixing this...if you get a moment, can you try the version i compiled and put up at https://www.dropbox.com/s/bbdcpvwevkpgtb6/CCA-Setup-1.0.0-beta1.exe?dl=1 ?

patrickhlauke commented 6 years ago

(additionally, for what it's worth, i'm beginning to suspect this is something fundamentally to do with win-mouse - https://github.com/kapetan/win-mouse/issues/13)

alastc commented 6 years ago

No difference on my system, although, I've just realised that the value used is from where the mouse pointer is, but the 'wheel' is not in the right place.

I did a little vid.

As an aside, it would be really helpful if the bit inside the circle was magnified 2 or 3 times so you can hit text more easily.

patrickhlauke commented 6 years ago

I'm a doofus...it appears that once you create a new variable, you have to remember to actually use it...who knew?

in any case, when you get a chance, can i bother you to try (now updated) https://www.dropbox.com/s/bbdcpvwevkpgtb6/CCA-Setup-1.0.0-beta1.exe?dl=1 ?

alastc commented 6 years ago

That makes a difference, now the circle hovers about an inch to the right of the pointer.

patrickhlauke commented 6 years ago

ok, i'd hazard a guess that this can't be fixed in its current form. otherwise, the app would need to know the current configuration of your monitors, and their respective dprs, and remap what win-mouse sends back with that in mind. there's no real fix to that at the moment.

patrickhlauke commented 6 years ago

one last check, so at least i understand the current behaviour: what happens if you drag CCA to the other monitor, and start the picker there...does it then work accurately on THAT one, but not on the first one? i.e. is it at least consistent with the one it started on?

alastc commented 6 years ago

I haven't tried starting the picker on one monitor and moving it to another, I have moved the main CCA app to the monitor I'm working on.

What it does now is:

Given the other updates, it still works better on my setup than the old one.

patrickhlauke commented 6 years ago

thanks @alastc ... i think that's the best we can go for at this stage with the current win-mouse module. at least the problem is a bit mitigated, and we know fundamentally what's causing it.

ferllings commented 4 years ago

It should have been fixed by #153