fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

[BUG] Is Monitor Resolution Right On MacOS?

Open TwinklerG opened this issue 10 months ago • 2 comments

Read the FAQ first

  • [x] I have checked the FAQ but the issue is not covered

Description

On My MacBook-Air 13.6', I use 2304x1296 for my external monitor and 1470x956 for my internal monitor, but as you know, my external monitor is a typical 4K monitor with resolution 3840x1920 but fastfetch does not show the right one, and my internal monitor's resolution is 2560x1664 actually.

I clone the repository and try to check it out.

FFDisplayResult* display = ffdsAppendDisplay(ds,
                (uint32_t)CGDisplayModeGetPixelWidth(mode),
                (uint32_t)CGDisplayModeGetPixelHeight(mode),
                refreshRate,
                (uint32_t)CGDisplayModeGetWidth(mode),
                (uint32_t)CGDisplayModeGetHeight(mode),
                preferredWidth,
                preferredHeight,
                preferredRefreshRate,
                (uint32_t)CGDisplayRotation(screen),
                &buffer,
                CGDisplayIsBuiltin(screen) ? FF_DISPLAY_TYPE_BUILTIN : FF_DISPLAY_TYPE_EXTERNAL,
                CGDisplayIsMain(screen),
                (uint64_t)screen,
                physicalWidth,
                physicalHeight,
                "CoreGraphics"
            );

I found that the preferredWidth and preferrredHeight is the right answer while scaledWidth and scaledHeight which are got by Apple Core Graphics Library is not the desired ones, but that problem is out of my range.

Version used

2.57.1

Bug prevalence

Always

Regression

Not sure

Installation

Package manager

Package manager

brew

Screenshots

Image

Configuration


System information

It does not matter?

Features built-in

threads
vulkan
imagemagick7
chafa
zlib
sqlite3
libzfs
System yyjson

TwinklerG avatar Jan 20 '26 06:01 TwinklerG

It's correct behavior.

There are 4 resolutions

  1. The native/physical resolution. This is the number of physical pixels exists on your monitor.
  2. The real/framebuffer resolution. This is the resolution of images that GPU outputs. It can be smaller or larger than the native resolution, and will be scaled to the native resolution by your monitor.
  3. The scaled/logical resolution. This is what you see in macOS Settings. For HiDPI mode, a logical pixel is displayed by multiple physical pixels. Its value equals to <real-resolution> / <scale-factor>. For macOS, the scale factor is 2, which means 1 logical pixel equals to 4 real pixels.
  4. The preferred resolution. The default resolution chosen by OS. It's usually the highest resolution supported by your hardware, which is limited by the native resolution (of course), GPU, cable, port, etc. Node: OS may balance resolution and refresh rate. For example, HDMI 1.4 supports only 4K @ 30Hz and 2K @ 60Hz, an OS usually chooses 2K @ 60Hz as its default mode.

Fastfetch detects 2, 3, 4. By default, fastfetch prints <real-resolution> @ <scale-factor>x. You can customize the output with display.format, see fastfetch -h display-format for reference.

CarterLi avatar Jan 20 '26 08:01 CarterLi

Thank you for your detailed answer!

TwinklerG avatar Jan 20 '26 08:01 TwinklerG