From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#30074: 26.0; Add function(s) for current monitor info Date: Sun, 14 Jul 2019 15:07:57 -0700 (PDT) Message-ID: <3dfc61af-838b-49e0-bd81-2cc3ed89fb04@default> References: <17da2391-a30c-4d5f-9ffd-1758b18c34f3@default> <87k1cky0e5.fsf@mouse.gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="268518"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 30074@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 15 00:09: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.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmmgB-0017l9-G3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jul 2019 00:09:11 +0200 Original-Received: from localhost ([::1]:34398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmmgA-0002R2-0Y for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 18:09:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmmg5-0002Gw-SQ for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 18:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmmg3-0001Qy-CJ for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 18:09:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37333) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmmg2-0001Qa-Tb for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 18:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmmg2-0003P2-GP for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 18:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 22:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30074 X-GNU-PR-Package: emacs Original-Received: via spool by 30074-submit@debbugs.gnu.org id=B30074.156314208913014 (code B ref 30074); Sun, 14 Jul 2019 22:09:02 +0000 Original-Received: (at 30074) by debbugs.gnu.org; 14 Jul 2019 22:08:09 +0000 Original-Received: from localhost ([127.0.0.1]:46153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmmfA-0003Np-KJ for submit@debbugs.gnu.org; Sun, 14 Jul 2019 18:08:08 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:43950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmmf8-0003NK-2Q for 30074@debbugs.gnu.org; Sun, 14 Jul 2019 18:08:07 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6EM43At017291; Sun, 14 Jul 2019 22:08:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=LtrWuXpUshdaPeQDGKotVTFvPlMZaRmM59SID8KJTiA=; b=EO1WtKR1LGnG/gNYgBdkPU/L3bfSNoiLNzLD2itffu3oNpV5N0fojxOQKzW2T+NKJTuh f4s9YfDBfhRd9+SR8OJ9k/NVlWQ+vnZTHT5h32kqp095FA2bz1wPk7P8FqeWMtw15mNn rIx3hsqeIdugIlrd6DS9R0psC6DPTcgxu9+y+jmClJWvFf7aLfrV0ARW1G+VpgHeLfxr s9rU+PJbvn1jgIbjGcJmpAicHtWc2y+p87cQUWye5qgz9GN1pYmC8AX+4HtOKCzSWbVl +lqs3QGjGHQa6F0S2OkQ3H86EFBPwNAfoqkXGsAXVy1fWnRpiSBGVsd9VeAGVfrfsPsZ QQ== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2tq6qtbj4j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Jul 2019 22:07:59 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6EM2Ns5167703; Sun, 14 Jul 2019 22:07:59 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2tq742860d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Jul 2019 22:07:59 +0000 Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x6EM7wCi016607; Sun, 14 Jul 2019 22:07:58 GMT In-Reply-To: <87k1cky0e5.fsf@mouse.gnus.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9318 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907140276 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9318 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907140276 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:163054 Archived-At: > > Please consider adding a function that returns the info describing the > > monitor that dominates a frame (default: selected frame). In > > particular, the size of the monitor. This can be useful, for example, > > for positioning a frame when there are multiple monitors. > > > > I've been using this, but you might have a better implementation in > > mind: > > > > (defun current-monitor (&optional frame) > > "Attributes of monitor that dominates FRAME (default: `selected-frame= ')." > > (catch 'current-monitor > > (dolist (atts (display-monitor-attributes-list frame)) > > (when (member (or frame (selected-frame)) (cdr (assq 'frames att= s))) > > (throw 'current-monitor atts))) > > nil)) ; Should never happen (?) >=20 > I guess it's possible for a frame to be on several monitors? (Half on > one and half on another.) What would this function return in that case? I'm not in front of multiple monitors now. Perhaps I can check later, when I am. In any case, all we have, AFAIK, is `display-monitor-attributes-list'. It decides what it returns. Attribute `frames' is described thus: "frames -- List of frames dominated by the physical monitor" For the same frame to be "dominated" by more than one monitor I would wonder what good the word "dominated" could possibly do here. It suggests that one of the monitors dominates a given frame. Anyway, I'll try to remember to check, when I'm in the presence of > 1 monitor, unless someone beats me to it.