From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix fit-frame-to-buffer for multi-monitor setup. Date: Sat, 29 Feb 2020 17:05:28 +0100 Message-ID: <91a85405-ca57-096c-bb7e-058580b04577@gmx.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="81116"; mail-complaints-to="usenet@ciao.gmane.io" To: =?UTF-8?B?0KHQtdGA0LPQtdC5INCi0YDQvtGE0LjQvNC+0LI=?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 29 17:08:12 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j84ey-000L0Q-Pl for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Feb 2020 17:08:12 +0100 Original-Received: from localhost ([::1]:33482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j84ex-0005Gk-Kj for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Feb 2020 11:08:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51960) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j84cQ-0004Ze-Fg for emacs-devel@gnu.org; Sat, 29 Feb 2020 11:05:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j84cP-00007v-AT for emacs-devel@gnu.org; Sat, 29 Feb 2020 11:05:34 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:42405) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j84cP-00007g-0Z for emacs-devel@gnu.org; Sat, 29 Feb 2020 11:05:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1582992330; bh=iC2eY+Mtj6omQ+ARA/F88L/tBF6TELJXlhV38kjiOSA=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=E32/VOshu+Kfy3FRw2GSgHLCOww1p4GPMP9rD18msLEx4PmFWnPSNaX1WJlGdmsW6 ENjLi93IPCqBDMGRZ+wVF4fyjeyJighohy/T1GBUxakUl6pIWRbqkz5qRpy2h+m/xT PmvJxgUYcVU5hjpHrJ8667b2jkQvCzPt3wHL3Whk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.253]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MqJmF-1jlJ3x0Gxf-00nQG2; Sat, 29 Feb 2020 17:05:30 +0100 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:KqVxLjkEeTgxdcyRE244McsActgV5ut0i5xSaiGmmjCkrstuyVK the5Iod4DZyIaXjsvLJ+jU8F8m1V7Ro78NgyqhqNPmwrOxFKllj2aMjllNYNHVKrYkOGdl+ u6i25S4IaqAn9jy+6+S+3Ix9zZEweMtotm6166FKydBHf9951xRJiJ8c2py6G1yPt9kvAuQ 4SiM4jiHKiaUh2uNZciWw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Y0J3B+FSh/I=:FELVdx4obk5sq828Bb3saB G6mYZX6Q4+mPDW/6g3rg+aY7tT9GRFsHyLZybsZHrLZb/zfKW/FUM6ZXK4jToHoB/EK9uUoLM GYQ9eljT5gcbQoel1Z7SXXyvFaINNilFLeP9G/ZPJvVYTModTaa3iCfufWqUc7kgRDBgNfE6K bWEVMhr4wXu8+5A8iOVCaGY+oB3mUo3B4X6tei6JV8PIefYfqY0LucAWnao+SZa+6rbzXMuDI AW2VPVnxtlJHGhz6zbLvphDBVBOsduNl1mXBYYHKM7HvxzvesklkWNB8LCOX3hDb2WXT2YH5h QiHUh7Q9FdJNdpSTHf6SvAksks+bt1Nu6qfhHhxjG6bqGvZgp+Chbs+Ool5tB/4cEPL9daO7z poVldlvFvW3Nbxs1OrtC0X+E3FdBK6bFFzNyD6dZ/j56AurIFhejXOAkITz0auIwlRrZSQjgq ybQDnuqcgyv1QM1UnvaoBLmbXkw4zt4IWgjB3ck+MV2G5dEc+a5v48bfJxVAXXJKxVQofuB4J IiamwJcLGPstnFvi8QdK8gxrVaK3DIbVDsAfOIchyHO8gD78vls/xnFKT2ug47Xb5wg1wUZ8A J0j7rJXoxkC8iZV0RT8ReRqigySJ7xYSF+YwC2B1XgYKiTmuluCyLZJQ2PV7/K4JWTn1rXBVM cNGc8bXcuaSgOXUN7zxN16rZT5eETuMbL3we0+BkDyT0SAZqYh2lpIlnOX5ZfWBD3cJaer7Cu K6+u/B9d6C0kyKiFrjj7aG3ZLf4Fjb8iaykbRpA1HdznfIzB1XJevJHvtasD8FfrH4u4NWYQ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245125 Archived-At: > I've noticed `fit-frame-to-buffer` results in incorrect frame position > when the frame is not a child frame. I've looked into the code and > seems that there are two issues: first is that frame monitor is > ignored, always first monitor in `display-monitor-attributes-list` is > used. Good. I never really checked that since I always use only one monitor. Besides, 'frame-monitor-attributes' should be preferable anyway. > Second is that `workarea` and `geometry` are in the form of `(X > Y WIDTH HEIGHT)` but code treats them as `(X1 Y1 X2 Y2)`. I believe the reasoning was to avoid moving the frame whenever it already appears within its margins and thus constrain it to the region to the right of and below (X, Y). But my memory may fail. Could you provide an example where the original code results in bad placement? > I'm > providing a patch that fixes both issues. Thanks, martin