diff options
author | Stuart Langridge <sil@kryogenix.org> | 2022-01-02 11:47:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-02 11:47:59 +0000 |
commit | 6b62c2cf006fc612e6815d8d5776f26c3d87196d (patch) | |
tree | 9bf096cad1c5d91a896f89a604c86f1bf7c2af8d | |
parent | Merge pull request #11 from bgarnham/resize-fix (diff) | |
parent | Add option to force refresh from the commandline (diff) | |
download | magnus-6b62c2cf006fc612e6815d8d5776f26c3d87196d.tar.gz magnus-6b62c2cf006fc612e6815d8d5776f26c3d87196d.tar.bz2 magnus-6b62c2cf006fc612e6815d8d5776f26c3d87196d.zip |
Merge pull request #20 from krakissi/master
Add option to force refresh from the commandline.
-rwxr-xr-x | magnus | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -34,6 +34,7 @@ class Main(object): self.last_y = -1 self.refresh_interval = 250 self.started_by_keypress = False + self.force_refresh = False def handle_shutdown(self, app): if self.started_by_keypress: @@ -56,6 +57,14 @@ class Main(object): print(" Show about dialogue") print(" --refresh-interval=120") print(" Set refresh interval in milliseconds (lower is faster)") + print(" --force-refresh") + print(" Refresh every on interval even if the viewport has not moved.") + return 0 + + if "--force-refresh" in args: + # If this argument is supplied, refresh the view even if the mouse + # has not moved. Useful if the screen content is video. + self.force_refresh = True # Override refresh rate on command line for arg in args: @@ -235,7 +244,7 @@ class Main(object): (screen, x, y, modifier) = display.get_pointer() if x == self.last_x and y == self.last_y: # bail if nothing would be different - if not force_refresh: + if not force_refresh and not self.force_refresh: return True self.last_x = x self.last_y = y |