From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34516: Multi-monitor frame sets Date: Sat, 23 Feb 2019 22:48:25 +0200 Organization: LINKOV.NET Message-ID: <87h8cuw7s6.fsf@mail.linkov.net> References: <87bm3a74s4.fsf@mail.linkov.net> <83pnrpjb44.fsf@gnu.org> <8736okvlv2.fsf@mail.linkov.net> <86sgwkawnx.fsf@gmail.com> <87imxfv519.fsf@mail.linkov.net> <865ztf73x0.fsf@gmail.com> <87ftsip36g.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160972"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 34516@debbugs.gnu.org To: Andy Moreton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 23 22:04:15 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 1gxeSz-000fii-SS for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Feb 2019 22:04:14 +0100 Original-Received: from localhost ([127.0.0.1]:42551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxeSy-0002gt-RT for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Feb 2019 16:04:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxeSq-0002g9-78 for bug-gnu-emacs@gnu.org; Sat, 23 Feb 2019 16:04:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxeSp-0003iH-3V for bug-gnu-emacs@gnu.org; Sat, 23 Feb 2019 16:04:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxeSo-0003hn-Pc for bug-gnu-emacs@gnu.org; Sat, 23 Feb 2019 16:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gxeSo-0007T5-J9 for bug-gnu-emacs@gnu.org; Sat, 23 Feb 2019 16:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Feb 2019 21:04: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.155095581128642 (code B ref 34516); Sat, 23 Feb 2019 21:04:02 +0000 Original-Received: (at 34516) by debbugs.gnu.org; 23 Feb 2019 21:03:31 +0000 Original-Received: from localhost ([127.0.0.1]:49618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxeSI-0007Ru-Ta for submit@debbugs.gnu.org; Sat, 23 Feb 2019 16:03:31 -0500 Original-Received: from bird.maple.relay.mailchannels.net ([23.83.214.17]:62348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gxeSH-0007Rk-4x for 34516@debbugs.gnu.org; Sat, 23 Feb 2019 16:03:29 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 47BEC42856; Sat, 23 Feb 2019 21:03:27 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a42.g.dreamhost.com (unknown [100.96.28.213]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DDFB543238; Sat, 23 Feb 2019 21:03:26 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a42.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.3); Sat, 23 Feb 2019 21:03:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Soft-Lonely: 69f015434de996bf_1550955807040_4078756951 X-MC-Loop-Signature: 1550955807040:2843569595 X-MC-Ingress-Time: 1550955807039 Original-Received: from pdx1-sub0-mail-a42.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a42.g.dreamhost.com (Postfix) with ESMTP id A2D87804A6; Sat, 23 Feb 2019 13:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=zuG4PoA2KrCVxcYzqR3WB9XtN0Q=; b= RwHT0psabN9d1O/aEsIL6y3FVyL3g9em4gVj8XcN43Sy1JPU7SIa/yqzTPXuzibK GWAdAEtjsYEFLv/BjYLq9r1TYPNfESdxkmjt7c2BCB4KtdqtVsteiC/c/e9GAdvn U25cKLIkE1osA90b/QVM6IS0w7SbPsjDX7oiIX1COY4= Original-Received: from mail.jurta.org (m91-129-98-103.cust.tele2.ee [91.129.98.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a42.g.dreamhost.com (Postfix) with ESMTPSA id 584F28049F; Sat, 23 Feb 2019 13:03:23 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a42 In-Reply-To: (Andy Moreton's message of "Wed, 20 Feb 2019 21:38:02 +0000") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddruddvgddugeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelkedruddtfeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelkedruddtfedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegrnhgurhgvfihjmhhorhgvthhonhesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt 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:155701 Archived-At: --=-=-= Content-Type: text/plain > You should always use the workarea values for displaying emacs frames. Ok, this patch uses the workarea instead: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=make-frame-on-monitor.3.patch diff --git a/lisp/frame.el b/lisp/frame.el index dc81302939..648944952f 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -644,9 +644,43 @@ window-system-for-display (defun make-frame-on-display (display &optional parameters) "Make a frame on display DISPLAY. The optional argument PARAMETERS specifies additional frame parameters." - (interactive "sMake frame on display: ") + (interactive (list (completing-read + (format "Make frame on display: ") + (delete-dups + (mapcar (lambda (frame) + (frame-parameter frame 'display)) + (frame-list)))))) (make-frame (cons (cons 'display display) parameters))) +(defun make-frame-on-monitor (monitor &optional display parameters) + "Make a frame on monitor MONITOR. +The optional argument DISPLAY can be a display name, and the optional +argument PARAMETERS specifies additional frame parameters." + (interactive (list (completing-read + (format "Make frame on monitor: ") + (mapcar (lambda (a) + (cdr (assq 'name a))) + (display-monitor-attributes-list))))) + (let* ((monitor-geometry + (car (delq nil (mapcar (lambda (a) + (when (equal (cdr (assq 'name a)) monitor) + (cdr (assq 'workarea a)))) + (display-monitor-attributes-list display))))) + (frame-geometry + (when monitor-geometry + (x-parse-geometry (format "%dx%d+%d+%d" + (nth 2 monitor-geometry) + (nth 3 monitor-geometry) + (nth 0 monitor-geometry) + (nth 1 monitor-geometry))))) + (frame-geometry-in-pixels + (when frame-geometry + `((top . ,(cdr (assq 'top frame-geometry))) + (left . ,(cdr (assq 'left frame-geometry))) + (height . (text-pixels . ,(cdr (assq 'height frame-geometry)))) + (width . (text-pixels . ,(cdr (assq 'width frame-geometry)))))))) + (make-frame (append frame-geometry-in-pixels parameters)))) + (declare-function x-close-connection "xfns.c" (terminal)) (defun close-display-connection (display) --=-=-=--