GNU bug report logs - #34516
Multi-monitor frame sets

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 17 Feb 2019 21:10:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 34516 <at> debbugs.gnu.org
Subject: Re: bug#34516: Multi-monitor frame sets
Date: Sun, 24 Feb 2019 13:56:31 +0100
Juri Linkov <juri <at> linkov.net> writes:

>>>> I donʼt mind it, but it won't work on macOS, since thereʼs no 'name
>>>> entries in 'display-monitor-attributes-list' (and adding them looks
>>>> non-trivial, unless we go for 'Monitor-1', Monitor-2' etc.)
>>>
>>> Are there other NS-specific attributes that could provide
>>> a clear reference to a specific monitor?  Maybe ‘geometry’
>>> could be used to deduce a relative arrangement of monitors?
>>
>> I guess it could. Or we could fake up a monitor name on those systems
>> where ns_screen_name doesnʼt work.
>
> Since on Windows 'display-monitor-attributes-list' returns such
> fake monitor names:
>
>   \\.\DISPLAY1
>   \\.\DISPLAY2
>
> on macOS it could return something like that or generate fake names
> from geometry like "1920x1080+0+0", "2560x1440+1920+16".

I often have two identical monitors attached, so that would be
confusing :-)

Something like this (assuming nobody every connects more than 9
monitors to the same system).

diff --git a/src/nsfns.m b/src/nsfns.m
index edcdb988f7..91ab17032c 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2698,6 +2698,12 @@ and GNUstep implementations ("distributor-specific release
 
 #ifdef NS_IMPL_COCOA
       m->name = ns_screen_name (did);
+      if (m->name == NULL)      /* Fallback value.  */
+        {
+          char name[9];
+          snprintf (name, sizeof(name), "DISPLAY%1d", i+1);
+          m->name = xstrdup (name);
+        }
 
       {
         CGSize mms = CGDisplayScreenSize (did);






This bug report was last modified 6 years and 51 days ago.

Previous Next


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