Subject: 24.4.50; positioning frames on multi-monitor displays

From: Drew Adams <[email-masked]>
Date: Tue, 7 Oct 2014 11:29:29 -0700 (PDT)

This is a followup to the thread for bug #18637.  Please see that
thread.

It's not clear to me how to understand/calculate which monitor a given
frame will be displayed on, or how (if at all possible) to control which
monitor is used.

What the code in question does is to (a) save the original `left',
`top', `width', and `height' frame parameter values for a frame, and
then to change those, using `modify-frame-parameters', to resize the
frame to a "maximized" size (in quotes because the size does not
necessarily correspond exactly to what maximize might mean for the
window manager, and window-manager maximization is not employed).

The "restore" part of the code then calls `modify-frame-parameters'
to set the `left' etc. parameters back to the saved (original) values.
(The values are saved in new frame paramters, `restore-left', etc.)

The code does not delete or create any frames.  It just sets those frame
parameters.  The problem encountered is that the monitor in which the
frame is displayed changes.  The aim is to keep the frame on the same
monitor, regardless of the size change.

The OP reporting the problem is not, I think, on MS Windows, but I test
the code only on Windows.  The problem reported is likely on more than
one platform.  I would be interested in a platform-independent solution.

The code in question is commands `maximize-frame' and `restore-frame' in
this library: http://www.emacswiki.org/emacs-en/download/frame-cmds.el.
This other library is required by that one, in general:
http://www.emacswiki.org/emacs-en/download/frame-fns.el.

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-09-15 on LEG570
Bzr revision: 117884 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'