all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Maximize/restore frame function
@ 2014-10-03 17:31 Subhan Michael Tindall
  2014-10-03 18:50 ` Óscar Fuentes
  2014-10-04  5:49 ` Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: Subhan Michael Tindall @ 2014-10-03 17:31 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

Hi, I'm looking for a simple (hopefully!) function to maximize a frame/restore to it's previous size.
I've looked through the apropos and the closest I could find was  iconify-frame and iconify-or-deiconify-frame, neither of which quite does what I want.
What I want is function to toggle a given frame between being maximized on it's display and it's original size
I work in windows (bleh), I get this same functionality by double clicking on the top bar of the frame. This maximizes it to the monitor It's on.
Dual monitor setup with virtuawin multiple desktops if that helps.
Any ideas?
Subhan


Subhan Michael Tindall
Program Analyst - FamilyCare Health Plans
825 NE Multnomah St, Suite 1400; Portland OR 97232
Direct: 503-471-3127
Fax:      503-471-3177
Email:  subhant@familycareinc.org<mailto:subhant@familycareinc.org>
[Email-Signature-Logos June 20143]


This message is intended for the sole use of the individual and entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message.  Thank you.

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 30469 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Maximize/restore frame function
  2014-10-03 17:31 Maximize/restore frame function Subhan Michael Tindall
@ 2014-10-03 18:50 ` Óscar Fuentes
  2014-10-04  5:49 ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Óscar Fuentes @ 2014-10-03 18:50 UTC (permalink / raw)
  To: help-gnu-emacs

Subhan Michael Tindall <SubhanT@familycareinc.org> writes:

> Hi, I'm looking for a simple (hopefully!) function to maximize a
> frame/restore to it's previous size. I've looked through the apropos
> and the closest I could find was iconify-frame and
> iconify-or-deiconify-frame, neither of which quite does what I want.
> What I want is function to toggle a given frame between being
> maximized on it's display and it's original size I work in windows
> (bleh), I get this same functionality by double clicking on the top
> bar of the frame. This maximizes it to the monitor It's on. Dual
> monitor setup with virtuawin multiple desktops if that helps. Any
> ideas?

From NEWS:

* Changes in Emacs 24.4

...

*** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized',
bound to <f11> and M-<f10>, respectively.


`toggle-frame-maximized' is what you want.

Out there are Windows binaries for Emacs 24.4, which in pretest phase.

Before those functions I use a hack on .emacs for maximizing the frame.
I can't recall if it toggled the state, though.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Maximize/restore frame function
  2014-10-03 17:31 Maximize/restore frame function Subhan Michael Tindall
  2014-10-03 18:50 ` Óscar Fuentes
@ 2014-10-04  5:49 ` Drew Adams
  2014-10-05 18:13   ` Subhan Michael Tindall
  1 sibling, 1 reply; 5+ messages in thread
From: Drew Adams @ 2014-10-04  5:49 UTC (permalink / raw)
  To: Subhan Michael Tindall, help-gnu-emacs

> Hi, I'm looking for a simple (hopefully!) function to maximize a
> frame/restore to it's previous size.
> I've looked through the apropos and the closest I could find was
> iconify-frame and iconify-or-deiconify-frame, neither of which quite
> does what I want.
> What I want is function to toggle a given frame between being
> maximized on it's display and it's original size
> I work in windows (bleh), I get this same functionality by double
> clicking on the top bar of the frame. This maximizes it to the
> monitor It's on.
> Dual monitor setup with virtuawin multiple desktops if that helps.
> Any ideas?

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

There you will find commands `maximize-frame' and `restore-frame',
aka `toggle-max-frame'.  From the doc string:

,----
| Toggle maximization of FRAME horizontally, vertically, or both.
| Reverses or (if restored) repeats the effect of the Emacs maximize
| commands.  Does not restore from maximization effected outside Emacs.
| 
| With no prefix arg, toggle both directions.
| With a non-negative prefix arg, toggle only vertically.
| With a negative prefix arg, toggle horizontally.
| 
| When toggling both directions, each is toggled from its last maximize
| or restore state.  This means that using this after
| `maximize-frame-horizontally', `maximize-frame-vertically',
| `toggle-max-frame-horizontally', or `toggle-max-frame-vertically' does
| not necessarily just reverse the effect of that command.
`----

If you use a standalone minibuffer frame then "maximizing" another
frame leaves room for the minibuffer frame; it does not occlude it.

All of the commands in the library work with all Emacs versions
(starting with Emacs 20).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Maximize/restore frame function
  2014-10-04  5:49 ` Drew Adams
@ 2014-10-05 18:13   ` Subhan Michael Tindall
  2014-10-05 19:23     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Subhan Michael Tindall @ 2014-10-05 18:13 UTC (permalink / raw)
  To: 'Drew Adams', help-gnu-emacs@gnu.org

> -----Original Message-----
> From: Drew Adams [mailto:drew.adams@oracle.com]
> Sent: Friday, October 03, 2014 10:50 PM
> To: Subhan Michael Tindall; help-gnu-emacs@gnu.org
> Subject: RE: Maximize/restore frame function
> 
> > Hi, I'm looking for a simple (hopefully!) function to maximize a
> > frame/restore to it's previous size.
> > I've looked through the apropos and the closest I could find was
> > iconify-frame and iconify-or-deiconify-frame, neither of which quite
> > does what I want.
> > What I want is function to toggle a given frame between being
> > maximized on it's display and it's original size I work in windows
> > (bleh), I get this same functionality by double clicking on the top
> > bar of the frame. This maximizes it to the monitor It's on.
> > Dual monitor setup with virtuawin multiple desktops if that helps.
> > Any ideas?
> 
> 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
> 
> There you will find commands `maximize-frame' and `restore-frame', aka
> `toggle-max-frame'.  From the doc string:
> 
> ,----
> | Toggle maximization of FRAME horizontally, vertically, or both.
> | Reverses or (if restored) repeats the effect of the Emacs maximize
> | commands.  Does not restore from maximization effected outside Emacs.
> |
> | With no prefix arg, toggle both directions.
> | With a non-negative prefix arg, toggle only vertically.
> | With a negative prefix arg, toggle horizontally.
> |
> | When toggling both directions, each is toggled from its last maximize
> | or restore state.  This means that using this after
> | `maximize-frame-horizontally', `maximize-frame-vertically',
> | `toggle-max-frame-horizontally', or `toggle-max-frame-vertically' does
> | not necessarily just reverse the effect of that command.
> `----
> 
> If you use a standalone minibuffer frame then "maximizing" another frame
> leaves room for the minibuffer frame; it does not occlude it.
> 
> All of the commands in the library work with all Emacs versions (starting with
> Emacs 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.  
Subhan

This message is intended for the sole use of the individual and entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message.  Thank you.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Maximize/restore frame function
  2014-10-05 18:13   ` Subhan Michael Tindall
@ 2014-10-05 19:23     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2014-10-05 19:23 UTC (permalink / raw)
  To: Subhan Michael Tindall, help-gnu-emacs

> > 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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-10-05 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-03 17:31 Maximize/restore frame function Subhan Michael Tindall
2014-10-03 18:50 ` Óscar Fuentes
2014-10-04  5:49 ` Drew Adams
2014-10-05 18:13   ` Subhan Michael Tindall
2014-10-05 19:23     ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.