GUI: fix Wayland scaling factor detection
when full-screen is on
This commit is contained in:
		
							parent
							
								
									c83232f8da
								
							
						
					
					
						commit
						6f6128cae7
					
				|  | @ -3535,7 +3535,8 @@ bool FurnaceGUI::loop() { | ||||||
|     // update config x/y/w/h values based on scrMax state
 |     // update config x/y/w/h values based on scrMax state
 | ||||||
|     if (updateWindow) { |     if (updateWindow) { | ||||||
|       logV("updateWindow is true"); |       logV("updateWindow is true"); | ||||||
|       if (!scrMax) { |       if (!scrMax && !fullScreen) { | ||||||
|  |         logV("updating scrConf"); | ||||||
|         scrConfX=scrX; |         scrConfX=scrX; | ||||||
|         scrConfY=scrY; |         scrConfY=scrY; | ||||||
|         scrConfW=scrW; |         scrConfW=scrW; | ||||||
|  | @ -6257,11 +6258,17 @@ bool FurnaceGUI::init() { | ||||||
|   // special consideration for Wayland
 |   // special consideration for Wayland
 | ||||||
|   if (settings.dpiScale<0.5f) { |   if (settings.dpiScale<0.5f) { | ||||||
|     if (strcmp(videoBackend,"wayland")==0) { |     if (strcmp(videoBackend,"wayland")==0) { | ||||||
|       if (scrW<1) { |       int realW=scrW; | ||||||
|  |       int realH=scrH; | ||||||
|  | 
 | ||||||
|  |       SDL_GetWindowSize(sdlWin,&realW,&realH); | ||||||
|  | 
 | ||||||
|  |       if (realW<1) { | ||||||
|         logW("screen width is zero!\n"); |         logW("screen width is zero!\n"); | ||||||
|         dpiScale=1.0; |         dpiScale=1.0; | ||||||
|       } else { |       } else { | ||||||
|         dpiScale=(double)canvasW/(double)scrW; |         dpiScale=(double)canvasW/(double)realW; | ||||||
|  |         logV("we're on Wayland... scaling factor: %f",dpiScale); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 tildearrow
						tildearrow