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

From: Ship Mints <[email-masked]>
Date: Tue, 4 Mar 2025 06:00:24 -0500

On Tue, Mar 4, 2025 at 2:14 AM Juri Linkov <[email-masked]> wrote:

> > 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")
>

I'll try to dig into this a little more this week.  d-m-a-l "works" for me
but doesn't have a monitor name.  Perhaps it names them only when there's
more than one.  I'll look in Apple's docs also.