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

From: Robert Pluim <[email-masked]>
Date: Tue, 04 Mar 2025 14:18:26 +0100

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

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

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

    Juri> and on GNU/Linux it correctly returns

    Juri> ("HDMI-1" "eDP-1")

See also bug#34516, which has a patch from me to invent monitor names
on macOS.

That bug also points at code from <https://github.com/glfw/glfw>,
which someone motivated could perhaps copy.

<https://github.com/glfw/glfw/blob/master/LICENSE.md> is as follows:

    Copyright (c) 2002-2006 Marcus Geelnard

    Copyright (c) 2006-2019 Camilla Löwy

    This software is provided 'as-is', without any express or implied
    warranty. In no event will the authors be held liable for any damages
    arising from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:

    The origin of this software must not be misrepresented; you must
    not claim that you wrote the original software. If you use this
    software in a product, an acknowledgment in the product
    documentation would be appreciated but is not required.

    Altered source versions must be plainly marked as such, and must
    not be misrepresented as being the original software.

    This notice may not be removed or altered from any source
    distribution.

Robert
--