From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Maximize/restore frame function Date: Sun, 5 Oct 2014 12:23:55 -0700 (PDT) Message-ID: References: <0a8efd3b-4f9e-4070-9bbc-2679ec47ef70@default> <07aa7063841d4e43a94b6dae1f6a41a0@fcmailsvr2.familycareinc.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1412537078 19387 80.91.229.3 (5 Oct 2014 19:24:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Oct 2014 19:24:38 +0000 (UTC) To: Subhan Michael Tindall , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 05 21:24:32 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XarQ0-00040D-1X for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 21:24:32 +0200 Original-Received: from localhost ([::1]:48464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XarPz-0005vp-JT for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Oct 2014 15:24:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XarPi-0005ug-2o for help-gnu-emacs@gnu.org; Sun, 05 Oct 2014 15:24:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XarPb-0001Dm-9S for help-gnu-emacs@gnu.org; Sun, 05 Oct 2014 15:24:14 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:40906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XarPb-0001DU-49 for help-gnu-emacs@gnu.org; Sun, 05 Oct 2014 15:24:07 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s95JO1HN022584 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 5 Oct 2014 19:24:04 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s95JNwn0023261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 5 Oct 2014 19:24:01 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s95JNw1i012371; Sun, 5 Oct 2014 19:23:58 GMT In-Reply-To: <07aa7063841d4e43a94b6dae1f6a41a0@fcmailsvr2.familycareinc.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100294 Archived-At: > > As Oscar indicated, Emacs 24.4 has this. > > > > You can also toggle maximization (but not fullscreen), on all > > platforms in all Emacs versions (starting with Emacs 20), using > > library `frame-cmds.el', which you can get from Emacs Wiki (or > > MELPA), http://www.emacswiki.org/emacs-en/download/frame-cmds.el >=20 > The commands are exactly what I want, but don't work properly with a > multi-monitor setup. > > Maximize & restore will jump the frame from left monitor to right & > vice versa. It doesn't appear to be tracking the original location > either. > > So, for example, when I maximize a frame in the left monitor(which > does not have a menu bar), the frame is moved to the right monitor, > maximized for that monitor, and igores the menu bar so oversizes the > frame. I see. Sorry about that. I don't have a multi-monitor setup, so I can't easily look into this. Perhaps you or someone else has a suggestion, to improve the behavior in this context. You might be able to use `debug-on-entry' with `maximize-frame' or `restore-frame', to see better what the problem is and possibly what a good correction might be. I suspect that the problem is that the only info saved for later restoring is the original values of frame parameters `left', `top', `width', and `height', and that restoring those in another monitor is not sufficient. But I wonder anyway why maximizing or restoring switches to using another monitor (does it do so systematically, or only sometimes?). Perhaps it is easy to prevent that? Then the saved info would presumably be sufficient to DTRT. IOW, perhaps you could try first to find out why it is moving the frame to the other monitor, and see if you can prevent that. Or perhaps you can come up with other info (e.g. frame parameters) to save, so that restoring/maximizing to a different monitor DTRT. I know nothing about using multiple monitors with Emacs. In the Elisp manual (node `Multiple Terminals', formerly `Multiple Displays'), I see that there are some new (Emacs 24.4) functions, `display-monitor-attributes-list' and `frame-monitor-attributes'. Perhaps they would be a good starting point for looking into this. [FWIW, I just filed doc bug #18636, about the argument to `display-monitor-attributes-list'. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18636] I notice, for example, that this Emacs 24.3 text in that node: On some "multi-monitor" setups, a single X display outputs to more than one monitor. Currently, there is no way for Emacs to distinguish between the different physical monitors. was replaced by this text for Emacs 24.4: On some "multi-monitor" setups, a single X display outputs to more than one physical monitor. `display-monitor-attributes-list' and `frame-monitor-attributes' can be used to obtain information about each physical monitor on multi-monitor setups. I don't see anything, offhand, that speaks to how to control which monitor something gets displayed on. There is frame parameter `display', but I'm not sure whether setting this is a way to control which monitor is used. Perhaps you could check. If you do decide to look into this, it's best to follow up with me off list wrt debugging and details. If people have general suggestions about this then of course the list is appropriate for that.