Skip to content

Commit

Permalink
#4365 clamp 'vrefresh' to a useful range
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 23, 2024
1 parent ecd20b6 commit 62a958b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xpra/client/gtk3/gtk_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@
NO_OPENGL_WINDOW_TYPES = os.environ.get("XPRA_NO_OPENGL_WINDOW_TYPES",
"DOCK,TOOLBAR,MENU,UTILITY,SPLASH,DROPDOWN_MENU,POPUP_MENU,TOOLTIP,NOTIFICATION,COMBO,DND").split(",")

VREFRESH = envint("XPRA_VREFRESH", 0)
MIN_VREFRESH = envint("XPRA_MIN_VREFRESH", 10)
MAX_VREFRESH = envint("XPRA_MAX_VREFRESH", 60)

inject_css_overrides()


Expand Down Expand Up @@ -255,7 +259,9 @@ def get_vrefresh(self) -> int:
rate = round(min(rates.values())/1000)
if rate<30 or rate>250:
rate = super().get_vrefresh()
return rate
if rate < 0:
return -1
return max(MIN_VREFRESH, min(MAX_VREFRESH, rate))


def _process_startup_complete(self, packet : PacketType) -> None:
Expand Down

0 comments on commit 62a958b

Please sign in to comment.