help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Maximize/restore frame function


From: Drew Adams
Subject: RE: Maximize/restore frame function
Date: Sun, 5 Oct 2014 12:23:55 -0700 (PDT)

> > 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
> 
> 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=18636]

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]