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: Fri, 29 Mar 2019 09:16:54 +0100 Message-ID: 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> <875zseft1x.fsf@mail.linkov.net> <8736n8t2ge.fsf@mail.linkov.net> <87imw2br1k.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="47748"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34516@debbugs.gnu.org, Alan Third , Andy Moreton To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 29 09:18:23 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 1h9miQ-000C8O-38 for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Mar 2019 09:18:18 +0100 Original-Received: from localhost ([127.0.0.1]:48383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9miO-0005FR-TX for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Mar 2019 04:18:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9miG-0005FM-0B for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 04:18:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9miB-0006qk-6P for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 04:18:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h9miA-0006qO-QL for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 04:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h9miA-0004tf-Hf for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 04:18:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87bm3a74s4.fsf@mail.linkov.net> Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Mar 2019 08:18:02 +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.155384742618743 (code B ref 34516); Fri, 29 Mar 2019 08:18:02 +0000 Original-Received: (at 34516) by debbugs.gnu.org; 29 Mar 2019 08:17:06 +0000 Original-Received: from localhost ([127.0.0.1]:35016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9mhG-0004sD-08 for submit@debbugs.gnu.org; Fri, 29 Mar 2019 04:17:06 -0400 Original-Received: from mail-qt1-f182.google.com ([209.85.160.182]:41111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9mhD-0004re-QB for 34516@debbugs.gnu.org; Fri, 29 Mar 2019 04:17:04 -0400 Original-Received: by mail-qt1-f182.google.com with SMTP id w30so1330538qta.8 for <34516@debbugs.gnu.org>; Fri, 29 Mar 2019 01:17:03 -0700 (PDT) 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:message-id:mime-version:content-transfer-encoding; bh=JraTjsS8xdDzqVDD5g9W3NBHkp/C5fd0HDFPyJu5ZfQ=; b=P9dZarqVf/nfOXg04tx28jAH8s4cIvOO964fuI+qS+4aH4igInsVMXzj0WKmd6/UFX /tOjJQ/ecz1uP22j9tgfaMSpMMOesxJQy4P3kW+/QLL3G50bZZg9JvawhJRsNourrkSY Aui2RNat6WvhS28s+RKSLiWkL3S+Zn5iuwJW8h0svzr02Pg2gA0V9QigeQSERf4DwaKI zM5F2WWx5jnFFylQER+2QtlMQSK+ddEQEesAIMq5OX+kj2P8+MT/P6FkcZAHEUazjrmv pwE8nhAZu6WsoZ1nhAhkHvdeOxIKQZBRdq+IVKj45rQfnMqYxlLyjAn8ZeS8dE2hYTp7 WWFw== 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:message-id:mime-version :content-transfer-encoding; bh=JraTjsS8xdDzqVDD5g9W3NBHkp/C5fd0HDFPyJu5ZfQ=; b=ZkT1vAiR+i4ca1de1hBkV9J6x/QETzgQWQsHoXr43XE+nHbkVaP+rlwXwvGK3sL5Vu 7pI36YtVBZhjLLocS3dxrNawDnIEbtl86v/mqBxwRBvRObaUaYAKciTE/4t7roMbbwTz pzd6OC2kvEx4y/3ZaPuhBOVMGSNSl2YK+I8SSoc1OGKeNBLzeyE6zZJVRoiq8oI80JvW 1jj6OO6vWQWMYMlC+rGpQxFmpio4cMfpUiyHv1YetA17abOvriOqQSErATfhzllJikEZ tkakhe19KQdyHdKXWicZz33JLMm8Yqlzg9gd7XIKd+JDhdUgH8jgfIwbmf1qvSLNgMPO /Y6Q== X-Gm-Message-State: APjAAAVoCdBSn+XQYV7boW7w+xG26ES5EO/43rDkludyOfKay66lTlE8 AObqoFP+oie/ikhSBcVKjcs= X-Google-Smtp-Source: APXvYqzX23TQ0EWy/ruwiuvxLeknG1f2OFLJS2uz4n1PQIakISfU07oRYy4y7TEtrN9JQ54Xd05a6w== X-Received: by 2002:a0c:b5d0:: with SMTP id o16mr9905813qvf.187.1553847418040; Fri, 29 Mar 2019 01:16:58 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id o188sm740092qkd.30.2019.03.29.01.16.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 01:16:56 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes 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:156911 Archived-At: >>>>> On Thu, 28 Mar 2019 23:57:43 +0200, Juri Linkov sai= d: Juri> Thanks for the hint. Now I added the default value to Juri> make-frame-on-monitor, so for the current monitor you can Juri> just do: M-x make-frame-on-monitor RET RET >>=20 >> Thanks for that. I guess we can close the bug, if it isn=CA=BCt >> closed already. Juri> But what about your implementation of monitor names for Juri> macOS? The fake ones? I guess I can push that, unless we have a working way to get the real ones. I haven=CA=BCt had a chance to look at the other project suggested by someone on this thread, nor do I know what license it=CA=BCs under. Current version below. Robert >From abcc4431240f9a9b3b9d8a22b3acbdb30b28f7d4 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 28 Feb 2019 10:13:05 +0100 Subject: [PATCH] Provide a fallback monitor name on macOS To: emacs-devel@gnu.org The fix for Bug#34516 provides a way to make a frame on a specific monitor. It relies on monitor names being available, which is not the case for recent versions of macOS, so provide fake ones of the form Monitorx. * src/nsfns.m (Fns_display_monitor_attributes_list): Provide a fallback for the monitor name if the existing methods don't work. --- src/nsfns.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nsfns.m b/src/nsfns.m index ee7598a1c7..3c4d8c91f3 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2587,6 +2587,12 @@ Frames are listed from topmost (first) to bottommost= (last). */) =20 #ifdef NS_IMPL_COCOA m->name =3D ns_screen_name (did); + if (m->name =3D=3D NULL) /* Fallback value. */ + { + char name[28]; + snprintf (name, sizeof(name), "Monitor%lu", i+1); + m->name =3D xstrdup (name); + } =20 { CGSize mms =3D CGDisplayScreenSize (did); --=20 2.21.0.196.g041f5ea1cf