diff options
| author | Alan Third | 2023-10-08 23:11:46 +0100 |
|---|---|---|
| committer | Alan Third | 2023-12-30 11:24:12 +0000 |
| commit | f3dec3439fd5aee885a76622f384f6c7ca67d128 (patch) | |
| tree | 1a3eef46af6f17207c2e53432575b4385e95bbf5 /src | |
| parent | 536674138d53e81f9e1d8bd7f3f7e744cc04fae2 (diff) | |
| download | emacs-f3dec3439fd5aee885a76622f384f6c7ca67d128.tar.gz emacs-f3dec3439fd5aee885a76622f384f6c7ca67d128.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsterm.m | 7 |
1 files changed, 5 insertions, 2 deletions
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) | |||
| 5256 | NSScreen *screen = [NSScreen mainScreen]; | 5256 | NSScreen *screen = [NSScreen mainScreen]; |
| 5257 | NSWindowDepth depth = [screen depth]; | 5257 | NSWindowDepth depth = [screen depth]; |
| 5258 | 5258 | ||
| 5259 | dpyinfo->resx = 72.27; /* used 75.0, but this makes pt == pixel, expected */ | 5259 | NSDictionary *dict = [screen deviceDescription]; |
| 5260 | dpyinfo->resy = 72.27; | 5260 | NSSize res = [[dict objectForKey:@"NSDeviceResolution"] sizeValue]; |
| 5261 | dpyinfo->resx = res.width; | ||
| 5262 | dpyinfo->resy = res.height; | ||
| 5263 | |||
| 5261 | dpyinfo->color_p = ![NSDeviceWhiteColorSpace isEqualToString: | 5264 | dpyinfo->color_p = ![NSDeviceWhiteColorSpace isEqualToString: |
| 5262 | NSColorSpaceFromDepth (depth)] | 5265 | NSColorSpaceFromDepth (depth)] |
| 5263 | && ![NSCalibratedWhiteColorSpace isEqualToString: | 5266 | && ![NSCalibratedWhiteColorSpace isEqualToString: |