diff options
author | David Robillard <d@drobilla.net> | 2019-11-10 22:10:21 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-11-10 22:10:21 +0100 |
commit | 41ae107a795ba1fffebfb6c30db32e2c97a65eb0 (patch) | |
tree | ed1e1a99d1bee97f8810f9ed8d0247e231bdf4d1 | |
parent | f6205cf8363579d02a96648ce5990948345add1c (diff) | |
download | jalv-41ae107a795ba1fffebfb6c30db32e2c97a65eb0.tar.gz jalv-41ae107a795ba1fffebfb6c30db32e2c97a65eb0.tar.bz2 jalv-41ae107a795ba1fffebfb6c30db32e2c97a65eb0.zip |
Ensure refresh rate is at least 30Hz
Gdk can allegedly report zero on some systems.
-rw-r--r-- | src/jalv_gtk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c index 8ca8258..71259bd 100644 --- a/src/jalv_gtk.c +++ b/src/jalv_gtk.c @@ -1162,7 +1162,9 @@ jalv_ui_refresh_rate(Jalv* jalv) GdkDisplay* const display = gdk_display_get_default(); GdkMonitor* const monitor = gdk_display_get_primary_monitor(display); - return (float)gdk_monitor_get_refresh_rate(monitor); + const float rate = (float)gdk_monitor_get_refresh_rate(monitor); + + return rate < 30.0f ? 30.0f : rate; #endif } |