Subject: bug#76691: `display-monitor-attributes-list` not working properly on macOS

From: Juri Linkov <[email-masked]>
Date: Tue, 04 Mar 2025 09:10:19 +0200

> I can reproduce this on current master, in other words,
>
>     M-x make-frame-on-monitor RET
>
> doesn't provide any completion candidates.
>
> In `make-frame-on-monitor`, I see that this
>
>     (mapcar (lambda (a)
>               (cdr (assq 'name a)))
>             (display-monitor-attributes-list))
>
> produces this on both macOS and GNU/Linux:
>
>     (nil nil)
>
> So I guess this is not specific to the NS port?
>
> Juri, since you added this command, WDYT?

The command just uses the output of `display-monitor-attributes-list`.
I don't know why `display-monitor-attributes-list` doesn't recognize
monitors on macOS and doesn't return their 'name'.  I tried

(mapcar (lambda (a)
          (cdr (assq 'name a)))
        (display-monitor-attributes-list))

and on GNU/Linux it correctly returns

("HDMI-1" "eDP-1")