GNU bug report logs - #76051
29.4; Incorrect workarea entry in display-monitor-attributes-list on macOS

Previous Next

Package: emacs;

Reported by: Anders Lindgren <andlind <at> gmail.com>

Date: Tue, 4 Feb 2025 13:43:02 UTC

Severity: normal

Tags: confirmed, patch

Merged with 76691

Found in versions 29.4, 30.1, 31.0.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alan Third <alan <at> idiocy.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76691: closed (`display-monitor-attributes-list` not working
 properly on macOS)
Date: Mon, 02 Jun 2025 20:18:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 2 Jun 2025 21:16:53 +0100
with message-id <aD4GtaDxcjshyXZG <at> faroe.holly.idiocy.org>
and subject line Re: 29.4; Incorrect workarea entry in display-monitor-attributes-list on macOS
has caused the debbugs.gnu.org bug report #76051,
regarding `display-monitor-attributes-list` not working properly on macOS
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76051: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76051
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ruiyang Wu <ywwry66 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: `display-monitor-attributes-list` not working properly on macOS
Date: Sun, 2 Mar 2025 15:59:05 -0500
[Message part 3 (text/plain, inline)]
Hi,

I am using the official NS port Emacs 30.1 on a MacBook (macOS Sequoia) with an external monitor. The output of `display-monitor-attributes-list` is as follows:
> (((geometry 0 0 1512 982) (workarea 0 38 1512 944) (mm-size 301 195) (frames) (source . "NS")) ((geometry 1512 -517 1600 900 (workarea 1512 -517 1600 875) (mm-size 549 311) (frames #<frame scratch* 0x12d08e430>) (source . "NS")))
It fails to recognize my monitors. Furthermore, when I run `M-x make-frame-on-monitor`, no candidate is provided.

However, if I use `emacs-mac` from https://bitbucket.org/mituharu/emacs-mac/src/master/, the monitors can be correctly recognized. `display-monitor-attributes-list` prints
> (((geometry 0 0 1512 982) (workarea 0 38 1512 944) (mm-size 301 196) (frames) (name . "Built-in Retina Display") (backing-scale-factor . 2)) ((geometry 1512 -517 1600 900) (workarea 1512 -492 1600 875) (mm-size 549 311) (frames #<frame *scratch* - GNU Emacs at Ruiyangs-MBP 0x1400a62c8>) (name . "DELL U2515H") (backing-scale-factor . 2)))
And I can also use `make-frame-on-monitor` to create new frames without issue.

Is it possible to have the aforementioned behavior from `emacs-mac` in the official NS port? That would greatly improve my workflow. Thank you very much!

Best,
Ruiyang

[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Alan Third <alan <at> idiocy.org>
To: Anders Lindgren <andlind <at> gmail.com>
Cc: 76051-done <at> debbugs.gnu.org
Subject: Re: 29.4; Incorrect workarea entry in
 display-monitor-attributes-list on macOS
Date: Mon, 2 Jun 2025 21:16:53 +0100
On Mon, Jun 02, 2025 at 10:01:24PM +0200, Anders Lindgren wrote:
> Hi!
> 
> I have built a fresh Emacs with your patch, and it appears to be working
> well. Thanks!

Superb, thanks! I'll push it up to master now.

> I also put together a small Emacs package to draw the monitor layout with
> workareas as ASCII-boxes, based on the information provided by
> display-monitor-attributes-list. This makes it easier to check that the
> values returned are sane. I haven't published it yet, so I attached a copy.
> 
> For example, this is my mac layout with the laptop screen with doc to the
> right and an external monitor to the left. The numbers are the margin (in
> pixels), i.e. the space between the workarea and the full area of the
> monitor.
> 
> +---------------------------------------+
> |                                       |
> |                   ^ 25                |
> |                                       |
> |                                       |
> |                                       |
> |                                       |
> |                                       |
> |                                       |
> |                                       |
> |                                       |
> | < 0                              > 0  +--------------------------+
> |                                       |                          |
> |                                       |            ^ 38          |
> |                                       |                          |
> |                                       |                          |
> |                                       |                          |
> |                                       |                          |
> |                                       |                          |
> |                                       |                          |
> |                   v 0                 | < 0                 > 0  |
> |                                       |                          |
> +---------------------------------------+                          |
>                                         |                          |
>                                         |                          |
>                                         |                          |
>                                         |            v 66          |
>                                         |                          |
>                                         +--------------------------+
> 
> 
>     -- Anders

That's pretty cool!

-- 
Alan Third


This bug report was last modified 38 days ago.

Previous Next


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