unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 34516@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#34516: Multi-monitor frame sets
Date: Sat, 2 Mar 2019 20:54:24 +0000	[thread overview]
Message-ID: <20190302205424.GB20712@breton.holly.idiocy.org> (raw)
In-Reply-To: <m2k1hpqr9c.fsf@gmail.com>

On Sun, Feb 24, 2019 at 01:56:31PM +0100, Robert Pluim wrote:
> Juri Linkov <juri@linkov.net> writes:
> 
> > 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 :-)

I’m a bit late to this conversation, sorry.

I’d hope that the geometry would contain the origin of the monitor in
the overall screen ‘space’, so the primary monitor would have 0, 0,
and one to the left would have -1920, 0, or something. So it might not
be too 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 appears to be the only place that ns_screen_name is called, so it
would probably be better to put this code in it and make
ns_screen_name return a name no matter what.

Also, it might be worth considering using the ‘did’ value instead of
‘i’. As far as I can tell it’s just a uint32_t, and should stay the
same as long as the system isn’t rebooted.
-- 
Alan Third





  parent reply	other threads:[~2019-03-02 20:54 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-17 19:34 bug#34516: Multi-monitor frame sets Juri Linkov
2019-02-18 10:47 ` Robert Pluim
2019-02-18 21:03   ` Juri Linkov
2019-02-19  9:17     ` Robert Pluim
2019-02-23 20:43       ` Juri Linkov
2019-02-24 12:56         ` Robert Pluim
2019-02-24 21:08           ` Juri Linkov
2019-02-24 22:11             ` Andy Moreton
2019-02-25 21:11               ` Juri Linkov
2019-03-02 20:54           ` Alan Third [this message]
2019-03-02 23:57             ` Andy Moreton
2019-03-03 11:43               ` Alan Third
2019-03-04  9:52                 ` Robert Pluim
2019-03-04 13:56                   ` Andy Moreton
2019-03-04 16:10                     ` Robert Pluim
2019-03-04 19:20                       ` Alan Third
2019-03-04 20:18                         ` Robert Pluim
2019-03-19 21:33                           ` Juri Linkov
2019-03-26  7:24                             ` Robert Pluim
2019-03-26  7:26                               ` Robert Pluim
2019-03-27 21:46                                 ` Juri Linkov
2019-03-28  7:56                                   ` Robert Pluim
2019-03-28 21:57                                     ` Juri Linkov
2019-02-18 16:48 ` Eli Zaretskii
2019-02-18 21:16   ` Juri Linkov
2019-02-19  3:32     ` Eli Zaretskii
2019-02-19 21:37       ` Juri Linkov
2019-02-19 10:40     ` Andy Moreton
2019-02-19 21:31       ` Juri Linkov
2019-02-19 23:29         ` Andy Moreton
2019-02-20 21:20           ` Juri Linkov
2019-02-20 21:38             ` Andy Moreton
2019-02-23 20:48               ` Juri Linkov
2019-02-24  8:44                 ` martin rudalics
2019-02-24 21:08                   ` Juri Linkov
2019-02-24 22:13                   ` Andy Moreton
2019-02-25 10:13                     ` martin rudalics
2019-02-25 15:00                       ` Andy Moreton
2019-03-05  0:44 ` Andy Moreton
2019-03-29  8:16 ` Robert Pluim
2019-03-30 21:47   ` Juri Linkov
2019-04-01 11:29     ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190302205424.GB20712@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=34516@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).