From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#34516: Multi-monitor frame sets Date: Sun, 24 Feb 2019 13:56:31 +0100 Message-ID: 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: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="188836"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34516@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 24 13:57:18 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 1gxtLF-000mvx-L1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2019 13:57:13 +0100 Original-Received: from localhost ([127.0.0.1]:49949 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxtLE-0001X6-Ne for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Feb 2019 07:57:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxtL5-0001Wo-Aw for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 07:57:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxtL4-0000VJ-Fn for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 07:57:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxtL4-0000V2-6n for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 07:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gxtL3-0006yw-Vm for bug-gnu-emacs@gnu.org; Sun, 24 Feb 2019 07:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Feb 2019 12:57: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.155101300226813 (code B ref 34516); Sun, 24 Feb 2019 12:57:01 +0000 Original-Received: (at 34516) by debbugs.gnu.org; 24 Feb 2019 12:56:42 +0000 Original-Received: from localhost ([127.0.0.1]:49882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxtKk-0006yP-F8 for submit@debbugs.gnu.org; Sun, 24 Feb 2019 07:56:42 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:34679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxtKi-0006yC-E6 for 34516@debbugs.gnu.org; Sun, 24 Feb 2019 07:56:41 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id o10so1026208wmc.1 for <34516@debbugs.gnu.org>; Sun, 24 Feb 2019 04:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=cmqZwZGgG9UKEnbjDdvjAfj3TaTVcTZiJvGthTx55GU=; b=eeuA3qL51VwYkHwQWkItfQqzLa4Psjhd/Z37MkzMxm70qXDadvw62XgvDQdoiGCImO tW1vZ8xqYs/xfZlDED/FfOGQjPuO9Trys5Wei5tkvawDO9V2jYP1lGh5EioigVrl1KW4 LU3eW16sDFBbAr8n2THrTI826Mu/9c9mJ3IZSp2LhLvntzTHqqMqWyVHh6Q6OQJ3Zsv9 9942IXo4tgm7goDHIn+jkijXDjCBZJKafu4sPC2i/YbpMkK8qEr3iM/s35ZaaJGlq39C REelbTbbmwt3gvGnVZrg3WfMU4OH/DYcGydt/MEDRS1I8bNXxjw9vjIYGmVmprsQ4BUb SIkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=cmqZwZGgG9UKEnbjDdvjAfj3TaTVcTZiJvGthTx55GU=; b=GXHGG4NgQ6369FzcLKWV5fsvA819EzYQLQXKmJfSB3ztW+coooyeXUPC+DAVyBYfV6 FvUPP1sPDUHSA2M4OquSr+7hjQ9GWA39vBdVBlmoU3Jb7Flf7SuJKVFugsRTPH7YPpLr NACYIgRytcpayJSYcCZaWuBSsLInN4/d00iwaXlR/wbK8dIWWzGNAXB6pifbVnvtx2S8 oN6+nnZ3oC9A3wjadvtHIgjsphnfLMxEWxduycpcW2ATUeICh/vetghMNun24q7JZ8UO 546CbV+3EK0TgIjZiDn8NlW8/0eps5G+pVy5m3ZKVq4NVXCxmvVvi2aonMHJHY7hE/Xs q5Qg== X-Gm-Message-State: AHQUAuZVuYWvyB75ogH92ZhxKxZpH8qcIv3KyL6p3IsbLmftPntqr2AI pd+8OBdbelRNGO4v+B/7Wx0JHSkN X-Google-Smtp-Source: AHgI3Ibm+0OpfxGiMohsHoJgMCY90ebAlH83f+jDmH8Ce2evuzQ9Mt30qdaE+rMvtpSQ1akM9FJRHw== X-Received: by 2002:a1c:342:: with SMTP id 63mr7502868wmd.34.1551012993898; Sun, 24 Feb 2019 04:56:33 -0800 (PST) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:8002:3916:e8ea:5231]) by smtp.gmail.com with ESMTPSA id c14sm8443507wrn.12.2019.02.24.04.56.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 24 Feb 2019 04:56:32 -0800 (PST) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87r2byw802.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 23 Feb 2019 22:43:41 +0200") 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:155711 Archived-At: Juri Linkov writes: >>>> I don=CA=BCt mind it, but it won't work on macOS, since there=CA=BCs n= o '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 =E2=80=98geometry=E2=80= =99 >>> 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=CA=BCt 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 r= elease =20 #ifdef NS_IMPL_COCOA m->name =3D ns_screen_name (did); + if (m->name =3D=3D NULL) /* Fallback value. */ + { + char name[9]; + snprintf (name, sizeof(name), "DISPLAY%1d", i+1); + m->name =3D xstrdup (name); + } =20 { CGSize mms =3D CGDisplayScreenSize (did);