GNU bug report logs - #76691
`display-monitor-attributes-list` not working properly on macOS

Previous Next

Package: emacs;

Reported by: Ruiyang Wu <ywwry66 <at> gmail.com>

Date: Sun, 2 Mar 2025 21:00:03 UTC

Severity: normal

Tags: confirmed, patch

Merged with 76051

Found in versions 29.4, 30.1, 31.0.50

Done: Alan Third <alan <at> idiocy.org>

Full log


Message #141 received at 76691 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 76691 <at> debbugs.gnu.org, Alan Third <alan <at> idiocy.org>,
 Stefan Kangas <stefankangas <at> gmail.com>, Ruiyang Wu <ywwry66 <at> gmail.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#76691: `display-monitor-attributes-list` not working properly
 on macOS
Date: Mon, 2 Jun 2025 06:52:35 -0400
[Message part 1 (text/plain, inline)]
On Mon, Jun 2, 2025 at 4:02 AM Robert Pluim <rpluim <at> gmail.com> wrote:

> >>>>> On Wed, 28 May 2025 15:17:33 -0400, Ship Mints <shipmints <at> gmail.com>
> said:
>     >> It applied cleanly alongside my patch, so I think we're good. I'll
> do
>     >> a test build in a bit and I think we can get both patches pushed up
>     >> once someone with two screen checks mine.
>     >>
>     >> Do you want to finish off the commit message or should I give it a
> go?
>     >>
>
>     Ship> Nice.  Not home where I have that branch locally, so writing this
>     Ship> manually...
>
>     Ship> *snip*
>     Ship> Fix ns_make_monitor_attribute_list (bug#76691)
>
>     Ship> This is the NS implementation for
> 'display-monitor-attributes-list'.
>     Ship> Change implementation from IORegistry to direct introspection
>     Ship> of NSScreen.
>
>     Ship> * src/nsfns.m (ns_make_monitor_attribute_list): Use localizedName
>     Ship> selector on NSScreen.  For anonymous displays, synthesize names
>     Ship> of the form ("%dx%d@%d,%d" width height x y).
>     Ship> (ns_get_name_from_ioreg) (ns_screen_name): Removed.
>     Ship> *snip*
>
> The latest version of your patch that I can see still doesnʼt allocate
> space for the '\0' at the end of the monitor name for the
> localizedName case.
>

Robert, thank you for keen eyes a second time.  This was a version I found
in my email, perhaps there was a later one on my other computer.

Alan, can you please change the name allocation to be:

       m->name = xmalloc ([name lengthOfBytesUsingEncoding:
NSUTF8StringEncoding] + 1);

Thanks,

-Stephane
[Message part 2 (text/html, inline)]

This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.