Re: FVWM: maximize and fullscreen

From: Greg BOGNAR <bognar_at_christal.elte.hu>
Date: Mon, 18 Oct 2004 01:34:34 +0200 (CEST)

On Tue, 12 Oct 2004, Dominik Vogt wrote:

> On Tue, Oct 12, 2004 at 12:37:42AM +0200, Greg BOGNAR wrote:
> > Hello,
> >
> > I have just upgraded to 2.5.11, and I would like to write a nice
> > window menu. And I also want to be able to maximize windows to "real"
> > fullscreen modes.
> >
> > A while back, I found a function like this in a posting:
> >
> > DestroyFunc FullScreen
> > AddToFunc FullScreen
> > + I ThisWindow (Maximized) WindowStyle Title, Borders
> > + I TestRc (!Match) WindowStyle !Title, !Borders
> > + I TestRc (!Match) Raise
> > + I TestRc (!Match) UpdateStyles
> > + I Maximize 100 100
> >
> > But I have problems with the menu:
> >
> > AddToMenu WindowMenu
> > + DynamicPopupAction Function WindowMenuFunc
> > DestroyFunc WindowMenuFunc
> > AddToFunc WindowMenuFunc
> > + I DestroyMenu recreate WindowMenu
> > + I AddToMenu WindowMenu
> > + I Current (Maximized) + "Unmaximize" Maximize false
> > + I Current (!Maximized) + "Maximize..." Maximize -60p 100
> > + I Current (??) + "Unfullscreen" FullScreen
> > + I Current (!??) + "Fullscreen" FullScreen
> >
> > What I'd like to have is this:
> > - an unmaximized, "unfullscreened" window can be maximized and also
> > "fullscreened", and the menu should say "Maximize" and "Fullscreen";
> > - a maximized, unfullscreen window can be unmaximized and also
> > fullscreened, and the menu should say so;
> > - a fullscreen window can be unfullscreened but it cannot be maximized
> > or unmaximized, only returned to its former (maximized or
> > unmaximized) state (I don't want to end up with unmaximized windows
> > without title and borders, but will this function do this?), and the
> > menu should grey out the (Un)Maximize item (is there a way to do
> > that?) or it should disappear altogether.
> >
> > I guessed that I have to define some State for the FullScreen function
> > (hence the ?? and !??), and then I could perhaps do something like
> > this:
>
> Exactly. Use this version of the FS functions:
>
> DestroyFunc FullScreenToggle
> AddToFunc FullScreenToggle
> + I ThisWindow (State 23) FullScreenOff
> + I TestRc (!Match) FullScreenOn
>
> DestroyFunc FullScreenOn
> AddToFunc FullScreenOn
> + I WindowStyle !Title, !Borders
> + I Raise
> + I UpdateStyles
> + I Maximize on 100 100
> + I State 23 on
>
> DestroyFunc FullScreenOff
> AddToFunc FullScreenOff
> + I WindowStyle Title, Borders
> + I Maximize off
> + I State 23 off
>
> And
>
> + I Current (Maximized, !State 23) + "Unmaximize" Maximize false
> + I Current (!Maximized) + "Maximize..." Maximize -60p 100
> + I Current (State 23) + "Unfullscreen" UnFullScreen
> + I Current (!State 23) + "Fullscreen" FullScreen
>
> But you need to upgrade to 2.5.12 to make it work. There is a bug
> in 2.5.11 (it erases the state when WindowStyle is called).

Thank you, it works -- and it works in 2.5.11 for me; I do not
experience the bug.

Cheers,
Greg

>
> > The manpage, however, doesn't say a lot about defining and using
> > states, and I have not been able to find examples. Is this the right
> > way to go at all?
>
> > Also, should there be separate FullScreen / UnFullScreen
> > functions instead of this one?
>
> I think so. TestRc should mainly be used with the break command,
> not to code different types of behaviour into one functions. It's
> too easy to get it all wrong.
>
> Ciao
>
> Dominik ^_^ ^_^
>
> --
> Dominik Vogt, dominik.vogt_at_gmx.de
>

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun Oct 17 2004 - 21:09:32 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST