|  | @@ -607,14 +607,14 @@ void logClear(){
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  #ifdef __linux__
 | 
	
		
			
				|  |  | -int la_GetDPI(){
 | 
	
		
			
				|  |  | +int la_GetDPI(Window* root_win){
 | 
	
		
			
				|  |  |      XRRScreenResources *screen;
 | 
	
		
			
				|  |  |      XRROutputInfo *info;
 | 
	
		
			
				|  |  |      XRRCrtcInfo *crtc_info;
 | 
	
		
			
				|  |  |      XRRCrtcInfo *crtc;
 | 
	
		
			
				|  |  |      int iscres, icrtc, dpi=0;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    screen=XRRGetScreenResources(MAIN.dpy, DefaultRootWindow(MAIN.dpy));
 | 
	
		
			
				|  |  | +    screen=XRRGetScreenResources(MAIN.dpy, root_win);
 | 
	
		
			
				|  |  |      for(iscres=0;iscres<screen->noutput;iscres++){
 | 
	
		
			
				|  |  |          info=XRRGetOutputInfo(MAIN.dpy,screen,screen->outputs[iscres]);
 | 
	
		
			
				|  |  |          if(!info->mm_width || !info->mm_height){ continue; }
 | 
	
	
		
			
				|  | @@ -637,7 +637,8 @@ int la_GetDPI(){
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  #endif
 | 
	
		
			
				|  |  |  #ifdef _WIN32
 | 
	
		
			
				|  |  | -int la_GetDPI(){
 | 
	
		
			
				|  |  | +int la_GetDPI(HWND win){
 | 
	
		
			
				|  |  | +    return GetDpiForWindow(win);
 | 
	
		
			
				|  |  |      return 144;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  #endif
 | 
	
	
		
			
				|  | @@ -978,7 +979,13 @@ int laGetReadyWith(laInitArguments* ia){
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  |      MAIN.FontSize = 0.6;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    int dpi=la_GetDPI(); if((!dpi) || dpi<96){ dpi=144; } if(dpi>300){ dpi=300; }
 | 
	
		
			
				|  |  | +#ifdef _WIN32
 | 
	
		
			
				|  |  | +    int dpi=la_GetDPI(hwnd);
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +#ifdef __linux__
 | 
	
		
			
				|  |  | +    int dpi = la_GetDPI(DefaultRootWindow(MAIN.dpy));
 | 
	
		
			
				|  |  | +#endif
 | 
	
		
			
				|  |  | +    if((!dpi) || dpi<144){ dpi=144; } if(dpi>300){ dpi=300; }
 | 
	
		
			
				|  |  |      int UiSize=(int)(tnsLinearItp(16.0f,24.0f,tnsGetRatiod(96,144,dpi))+0.5);
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  |      MAIN.UiRowHeight = MAIN.ScaledUiRowHeight =UiSize;
 |