Skip to content

Commit

Permalink
kvui: silently fail to disable DPI awareness on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Sep 30, 2023
1 parent a3907e8 commit 2d0bd8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import ctypes
# kivy 2.2.0 introduced DPI awareness on Windows, but it makes the UI enter an infinitely recursive re-layout
# by setting the application to not DPI Aware, Windows handles scaling the entire window on its own, ignoring kivy's
ctypes.windll.shcore.SetProcessDpiAwareness(0)
try:
ctypes.windll.shcore.SetProcessDpiAwareness(0)
except FileNotFoundError: # shcore may not be found on <= Windows 7
pass # TODO: remove silent except when Python 3.8 is phased out.

os.environ["KIVY_NO_CONSOLELOG"] = "1"
os.environ["KIVY_NO_FILELOG"] = "1"
Expand Down

0 comments on commit 2d0bd8d

Please sign in to comment.