Copy the database from the display connection
This allows to update the DB on the xctx.dpy object. Crawling the string from xctx.dpy will always return the xdefaults string, which represents the defaults from the initialisation, but not with any other updates.
This commit is contained in:
		
							parent
							
								
									e9e199c4ec
								
							
						
					
					
						commit
						9961efd10c
					
				| @ -60,17 +60,13 @@ static double screen_dpi_get_from_xft(void) | ||||
|                 screen_dpi_xft_cache = 0; | ||||
| 
 | ||||
|                 XrmInitialize(); | ||||
|                 char *xRMS = XResourceManagerString(xctx.dpy); | ||||
| 
 | ||||
|                 ASSERT_OR_RET(xRMS, screen_dpi_xft_cache); | ||||
| 
 | ||||
|                 XrmDatabase xDB = XrmGetStringDatabase(xRMS); | ||||
|                 char *xrmType; | ||||
|                 XrmValue xrmValue; | ||||
| 
 | ||||
|                 if (XrmGetResource(xDB, "Xft.dpi", "Xft.dpi", &xrmType, &xrmValue)) | ||||
|                 XrmDatabase db = XrmGetDatabase(xctx.dpy); | ||||
|                 ASSERT_OR_RET(db, screen_dpi_xft_cache); | ||||
|                 if (XrmGetResource(db, "Xft.dpi", "Xft.dpi", &xrmType, &xrmValue)) | ||||
|                         screen_dpi_xft_cache = strtod(xrmValue.addr, NULL); | ||||
|                 XrmDestroyDatabase(xDB); | ||||
|         } | ||||
|         return screen_dpi_xft_cache; | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Benedikt Heine
						Benedikt Heine