kvui: remove custom DPI scaling on windows (#2177)
This commit is contained in:
		
							parent
							
								
									fa2891f785
								
							
						
					
					
						commit
						2ef05a1799
					
				
							
								
								
									
										7
									
								
								kvui.py
								
								
								
								
							
							
						
						
									
										7
									
								
								kvui.py
								
								
								
								
							| 
						 | 
				
			
			@ -1,7 +1,14 @@
 | 
			
		|||
import os
 | 
			
		||||
import logging
 | 
			
		||||
import sys
 | 
			
		||||
import typing
 | 
			
		||||
 | 
			
		||||
if sys.platform == "win32":
 | 
			
		||||
    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)
 | 
			
		||||
 | 
			
		||||
os.environ["KIVY_NO_CONSOLELOG"] = "1"
 | 
			
		||||
os.environ["KIVY_NO_FILELOG"] = "1"
 | 
			
		||||
os.environ["KIVY_NO_ARGS"] = "1"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue