RonnyDo / ColorPicker

A color picker for elementaryOS.
GNU General Public License v3.0
107 stars 28 forks source link

Magnifier sees itself sometimes? #19

Closed peteruithoven closed 7 years ago

peteruithoven commented 7 years ago

Loving the new magnifier! But I am noticing some glitches, it sometimes seems to magnify on itself, as if the magnifier is added to the screen data it's magnifying. colorpicker glitches

I've just installed ColorPicker to 1.0.0.

System info:

         eeeeeeeeeeeeeeeee            peteruithoven@xps 
      eeeeeeeeeeeeeeeeeeeeeee         ----------------- 
    eeeee  eeeeeeeeeeee   eeeee       OS: elementary OS 0.4.1 Loki x86_64 
  eeee   eeeee       eee     eeee     Model: XPS 15 9550 
 eeee   eeee          eee     eeee    Kernel: 4.4.0-83-generic 
eee    eee            eee       eee   Uptime: 43 mins 
eee   eee            eee        eee   Packages: 2736 
ee    eee           eeee       eeee   Shell: bash 4.3.48 
ee    eee         eeeee      eeeeee   Resolution: 3840x2160 
ee    eee       eeeee      eeeee ee   DE: Pantheon 
eee   eeee   eeeeee      eeeee  eee   WM: Mutter(Gala) 
eee    eeeeeeeeee     eeeeee    eee   Terminal: pantheon-termin 
 eeeeeeeeeeeeeeeeeeeeeeee    eeeee    Terminal Font: Roboto Mono 10 
  eeeeeeee eeeeeeeeeeee      eeee     CPU: Intel i7-6700HQ (8) @ 3.500GHz 
    eeeee                 eeeee       GPU: Intel HD Graphics 530 
      eeeeeee         eeeeeee         GPU: NVIDIA GeForce GTX 960M 
         eeeeeeeeeeeeeeeee            Memory: 4749MiB / 31997MiB 
peteruithoven commented 7 years ago

Seems like it happens more the bigger the magnifier is. In the smallest mode I can't reproduce the issue. It also seems to happen more in areas where the color changes rapidly, on even coloured surfaces I can't reproduce the issue.

peteruithoven commented 7 years ago

It also happens very frequently when the magnifier touches my Wingpanel.

RonnyDo commented 7 years ago

Hey Peter, thanks for your detailed bug report! I'll try to reproduce it. As a workaround it may help to move the magnifier on a smaller zoomlevel and use the bigger zoom just over the spot you want to pick.

peteruithoven commented 7 years ago

I'd like to help you test any fixes. I'm able to build the source. But I have basically no experience with Vala and I don't really understand how you're filtering out the custom cursor. I'm assuming in Picker.snap?

RonnyDo commented 7 years ago

Yes this is the method. I just read the reference of https://valadoc.org/gdk-3.0/Gdk.pixbuf_get_from_window.html and it seems, the function pixbuf_get_from_window can fail in many ways. I will have a look on it and we'll see if this is the reason for our bug.

RonnyDo commented 7 years ago

Hi Peter I just released a new version, which should improve or even fix the issue the issue. A magnifier code is based on the ColourPicker of Stuart Langridge (https://github.com/stuartlangridge/ColourPicker/). He faces the same "flicker problem". It seems to have something to do with the maximum pointer size, which is even different for HiDPI and normal monitors. Please have a look at https://github.com/stuartlangridge/ColourPicker/issues/6 for a detailed description. Unfortunately I don't have a HiDPI monitor to validate any fixes. Could you or anyone with proper equipment check out the new version and give feedback?!

peteruithoven commented 7 years ago

I've tried this again on my HiDPI laptop and it seems to be totally fixed! :tada: It didn't magnify a screenshot with itself included any more. There where also no longer (partial) instances of the magnifier sticking around while moving. I've tried it after making the magnifier as big as possible since that would cause the most issues. I wouldn't explain the old behaviour as "flickering" btw.

Thanks for the great work!

RonnyDo commented 7 years ago

Good to hear! On my screen the magnifier flickered and had a kind of blurred tail. I couldn't really reproduce the "magnifier" sees itself behavior. Thanks to report the issue anyway :)