Get NS screen resolution from system

* src/nsterm.m (ns_initialize_display_info): Query the screen
deviceDescription for the resolution instead of hard-coding it.
This commit is contained in:
Alan Third 2023-10-08 23:11:46 +01:00
parent 536674138d
commit f3dec3439f

View file

@ -5256,8 +5256,11 @@ static Lisp_Object ns_string_to_lispmod (const char *s)
NSScreen *screen = [NSScreen mainScreen];
NSWindowDepth depth = [screen depth];
dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */
dpyinfo->resy = 72.27;
NSDictionary *dict = [screen deviceDescription];
NSSize res = [[dict objectForKey:@"NSDeviceResolution"] sizeValue];
dpyinfo->resx = res.width;
dpyinfo->resy = res.height;
dpyinfo->color_p = ![NSDeviceWhiteColorSpace isEqualToString:
NSColorSpaceFromDepth (depth)]
&& ![NSCalibratedWhiteColorSpace isEqualToString: