From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#34516: Multi-monitor frame sets Date: Sat, 2 Mar 2019 20:54:24 +0000 Message-ID: <20190302205424.GB20712@breton.holly.idiocy.org> References: <87bm3a74s4.fsf@mail.linkov.net> <87zhqsx115.fsf@mail.linkov.net> <87r2byw802.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="222444"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.11.2 (2019-01-07) Cc: 34516@debbugs.gnu.org, Juri Linkov To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 02 21:55:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h0Bf4-000vfk-9i for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Mar 2019 21:55:10 +0100 Original-Received: from localhost ([127.0.0.1]:58725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Bf3-0006QD-AS for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Mar 2019 15:55:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Bex-0006Pu-5k for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 15:55:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0Bew-0007QR-A4 for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 15:55:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0Bew-0007Q1-0E for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 15:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0Bev-0003a3-Rl for bug-gnu-emacs@gnu.org; Sat, 02 Mar 2019 15:55:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Mar 2019 20:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34516 X-GNU-PR-Package: emacs Original-Received: via spool by 34516-submit@debbugs.gnu.org id=B34516.155156007613730 (code B ref 34516); Sat, 02 Mar 2019 20:55:01 +0000 Original-Received: (at 34516) by debbugs.gnu.org; 2 Mar 2019 20:54:36 +0000 Original-Received: from localhost ([127.0.0.1]:57907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0BeW-0003ZN-Ed for submit@debbugs.gnu.org; Sat, 02 Mar 2019 15:54:36 -0500 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:45524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0BeT-0003Z9-Ni for 34516@debbugs.gnu.org; Sat, 02 Mar 2019 15:54:34 -0500 Original-Received: by mail-wr1-f48.google.com with SMTP id w17so1386377wrn.12 for <34516@debbugs.gnu.org>; Sat, 02 Mar 2019 12:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=l9f/XDdx7cnhg2RsSih/zRxAPDfsALeFh+pE8Jsl6so=; b=icXUQHPCbUEefeav56t4XfajeyxqTrFKWDhRpW0qsQ9Rtzt7EuDC3+1C56wH5ufDFr PQPsMJl2CcXeH5Z2+aBWUlL28hoHV0csUDLOl4UImPksFERvcdXf0/rVVsH3/DRbXKUQ zTSWZAKftRPOtrx8gktiw66SNL/XRkmYTQl7mKcpQXQBXzet/S0+Q51/WWEM33QdF6AK fLo1nAGIcRk9J1Xd+uI2Y8kObDVnrvkEO8zxQgz0JkYoWX7amadoatbe4puOYYYXk0bX jsnGrsEjewLSjehMj8j0j/IF5xQ+t2RcUztkOvkJ/do+7HAPeU7OpxkFTgLenda7X01i L0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=l9f/XDdx7cnhg2RsSih/zRxAPDfsALeFh+pE8Jsl6so=; b=egxeBXuct6JYpSsBdTSpy3H7NIuhu48DzL/TL8dvNTg5eKlWHwjPKqR4T9HCQhLt3O qqA8HmpjWpQ6EiuLn73rWtRnG/5JmfE3IGu9lycF2Zl4dwRg+xlgLJtdMVTKjDuSTUyT odlvKJoeQ5oii2QcSwxCdPEr272HMzpnpK7OFkgO9UTSRuUkNrt3p9Vloc01M+hjGcA6 CoN4abbah4PzLlMogHV0cuVYvYFzOuHJQDk1HS74ffArXhj8TJVRbXol5Xo043UlTzP5 K3juS/W91UpQLn4fNeVm+x4Ym7iRsryO8rK/g4QpN7TES+GxEIfnnoofIunErv5LWtE8 aDdQ== X-Gm-Message-State: APjAAAVTfib8zVvTURAxOV6DTZrSJyPOlJc+hwJLjJyMXBlwdo7rW3Vp UjYNWQkO9HZ77EyQ/3WRzQI= X-Google-Smtp-Source: APXvYqyzrrCVTiujNXg/D9youv+VC3fHWlWPwIDMiF5nauDb6gk574lO7xt0j27jWw/xL3E4BGBa3g== X-Received: by 2002:adf:ee45:: with SMTP id w5mr7501241wro.204.1551560067735; Sat, 02 Mar 2019 12:54:27 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-b45d-8a12-0e92-554b.holly.idiocy.org. [2001:8b0:3f8:8129:b45d:8a12:e92:554b]) by smtp.gmail.com with ESMTPSA id z8sm1564063wmi.28.2019.03.02.12.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Mar 2019 12:54:26 -0800 (PST) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155974 Archived-At: On Sun, Feb 24, 2019 at 01:56:31PM +0100, Robert Pluim wrote: > Juri Linkov 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