From: Alan Third Date: Sun, 8 Oct 2023 22:11:46 +0000 (+0100) Subject: Get NS screen resolution from system X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c47c4d9deb5b69641e8116d6e77fb89cf49facb8;p=emacs.git 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. (cherry picked from commit f3dec3439fd5aee885a76622f384f6c7ca67d128) --- diff --git a/src/nsterm.m b/src/nsterm.m index 2f736980ea6..dc4aef55113 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5256,8 +5256,11 @@ ns_initialize_display_info (struct ns_display_info *dpyinfo) 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: