From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#34516: Multi-monitor frame sets Date: Tue, 05 Mar 2019 00:44:44 +0000 Message-ID: <86r2bmno8z.fsf@gmail.com> References: <87zhqsx115.fsf@mail.linkov.net> <87r2byw802.fsf@mail.linkov.net> <20190302205424.GB20712@breton.holly.idiocy.org> <86r2bosuc0.fsf@gmail.com> <20190303114324.GA49402@breton.holly.idiocy.org> <20190304192017.GA21727@breton.holly.idiocy.org> 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="223913"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: 34516@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 05 01:58:06 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 1h0yPG-000w4V-1v for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Mar 2019 01:58:06 +0100 Original-Received: from localhost ([127.0.0.1]:35391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0yPF-00085M-2x for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Mar 2019 19:58:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0yNH-0006iD-Ns for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:56:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0yNG-0004FP-9o for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:56:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0yNG-0004Ey-5X for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h0yNF-0007da-W1 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:56:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87bm3a74s4.fsf@mail.linkov.net> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Mar 2019 00:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34516 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155174734829338 (code B ref -1); Tue, 05 Mar 2019 00:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Mar 2019 00:55:48 +0000 Original-Received: from localhost ([127.0.0.1]:60408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0yN2-0007d7-G5 for submit@debbugs.gnu.org; Mon, 04 Mar 2019 19:55:48 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h0yN0-0007ct-Nl for submit@debbugs.gnu.org; Mon, 04 Mar 2019 19:55:47 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0yMv-0003te-F7 for submit@debbugs.gnu.org; Mon, 04 Mar 2019 19:55:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0yMu-00066q-EE for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:55:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0yCW-0001ja-AG for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:44:57 -0500 Original-Received: from [195.159.176.226] (port=47524 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0yCW-0001gp-19 for bug-gnu-emacs@gnu.org; Mon, 04 Mar 2019 19:44:56 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1h0yCS-000hAE-Q1 for bug-gnu-emacs@gnu.org; Tue, 05 Mar 2019 01:44:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:p6YWz0Nu93ojqOkL4NNJQj5nThw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:156048 Archived-At: On Mon 04 Mar 2019, Alan Third wrote: > On Mon, Mar 04, 2019 at 05:10:59PM +0100, Robert Pluim wrote: >> Andy Moreton writes: >> >> >> At least in 'system preferences/display', when you have two identical monitors >> >> attached, they're called something like 'DELL 1234X' and 'DELL 1234X >> >> (2)' (I canʼt test that right now). If you can show me code on how to >> >> get those names in 10.14, I can confirm. That would be better than >> >> making up names. >> > >> >> So 'DELL 1234X (1)' and 'DELL 1234X (2)', where (1) is the primary >> monitor. >> >> > There are usually two different names involved: the name of the >> > file/device that represents the monitor, and a human-readable name for >> > the UI. >> > >> > In Windows, the GUI settings/display describes the monitors as 1 and >> > 2. In emacs, display-monitor-attributes-list reports the device >> > names \\.\DISPLAY1 and \\.\DISPLAY2 (you can see these device names >> > with the WinObj tool from SysInternals). Note that the device names do >> > not mention the make/model of the hardware. >> > >> > For OSX, ioreg or the IoRegistryExplorer app show similar information >> > from the IO registry (a non-persistent database of IO device >> > information). I don't use a mac any more, so I don't know if these tools >> > are still available). >> >> I donʼt know, but the code in ns_screen_name which appears to do >> something similar does not work for me in 10.14 > > Try this: > > ioreg -lw0 | grep IODisplayEDID | sed "/[^<]* > and see if it returns usable information. If so then that’s what we > should be targeting in ns_screen_name. > > I think the approach used in ns_screen_name must have been removed in > some version of macOS. I tried to modify it to find the information > returned by the above command, but it looks like there’s no direct way > to match up the DID number with IODisplayConnect, which is where > IODisplayEDID is stored. The #if tests in ns_screen_name suggest that the old method is no longer available in OSX 10.9 and later. >From a quick web search, GLFW (a graphics library) seems to have encountered this problem, and added a workaround in this commit: https://github.com/glfw/glfw/commit/8101d7a7b67fc3414769b25944dc7c02b58d53d0 The patch matches on "IODisplayConnect" instances and then iterates over the collection checking that the vendor ID and product ID match those values looked up from the DID number. A similar approach should help to solve this problem. AndyM