stuartlangridge / magnus

A very simple screen magnifier for Ubuntu
MIT License
38 stars 13 forks source link

Always update the magnifier display (even if the mouse hasn't moved) #15

Closed kankaristo closed 2 years ago

kankaristo commented 3 years ago

Just checking if the mouse hasn't moved is not enough to know that the magnifier shouldn't be updated.

Without this change, if your mouse stays still:

Feel free not to merge the PR (e.g. if the skip actually improves performance on low-end systems), but for my personal use, I never wan't to skip updating. I often zoom on editable text, and just not having a blinking text cursor looks weird.

Another option would be an "always update" command line option.

stuartlangridge commented 3 years ago

OK, so, I think this is a good idea -- I honestly hadn't thought of the screen changing without a mouse move, and you are right to catch this, so thank you! A question, though: your PR removes force_refresh entirely. Why not change line 150 to

    GLib.timeout_add(self.refresh_interval, self.poll, True)

so that we always poll with force_refresh once every 250ms?

kankaristo commented 3 years ago

The only other call to poll() also had force_refresh set to true. And the if statement checking if the mouse position has changed was also the only place in poll() where force_refresh was used.

So, the parameter would always be true, and it wouldn't really be used/read anymore inside poll(), so I figured it would be better to remove it completely.

stuartlangridge commented 2 years ago

Good call on this: I merged https://github.com/stuartlangridge/magnus/pull/20 which should cover the requirement!