FvwmEvent maximize

I want the titlebar to disappear when I maximize a window, and thought; no problem, I just use FvwmEvent but I can’t find an event when maximizing a window? am I missing something or is there no such thing?

How would I go about doing this without FvwmEvent?

Judging by the man, you’re correct. I don’t see an event for resizing. Instead of using fvwm event, you could make a function to maximize and remove the title, then bind that to whatever you had formerly bound the maximize to.

I use this:

DestroyFunc maximize-window-and-toggle-title
AddToFunc maximize-window-and-toggle-title
+ I CustomMaximize
+ I ToggleTitle

DestroyFunc CustomMaximize
AddToFunc CustomMaximize
+ I ThisWindow (State 4) DoUnMaximize
+ I TestRc (NoMatch) DoMaximize

DestroyFunc DoMaximize
AddToFunc DoMaximize
+ I ResizeMoveMaximize 100 100 0 0
+ I State 4 True

DestroyFunc DoUnMaximize
AddToFunc DoUnMaximize
+ I Maximize
+ I State 4 False

And then I bind the maximize to be Windows+M like this:

Key m A 4 maximize-window-and-toggle-title

But you could just as easily bind it to a window title decoration.

thanks for the reply!

I’ve gotten halfway with removing the title when maximizing, but it stays removed when I unmaximize… seems the “State 4” you’re using is the answer… thanks!

I think the relevant event is configure_window (but I’m not sure). If this is the case, you can bind a function that checks if the window is maximized and then remove the title.

Ok, so I’ve dropped the idea on removing titles, but I’d really like to remove border when maximizing windows… I’ve got this:

DestroyFunc MaximizeT
AddToFunc MaximizeT
+ I ThisWindow (State 4) DoUnMaximize
+ I TestRc (NoMatch) DoMaximize

DestroyFunc DoMaximize
AddToFunc DoMaximize
+ I ThisWindow (!State 4) WindowStyle NoHandles
+ I Maximize 100 100
+ I State 4 True

DestroyFunc DoUnMaximize
AddToFunc DoUnMaximize
+ I ThisWindow (State 4) WindowStyle !NoHandles
+ I Maximize
+ I State 4 False

This removes the handles and maximizes and reverts when done again, so it works… but the window doesn’t get maximized all the way… it seems like it gets resized first and then the handles are removed afterwards. (the size left on screen is same size as handles.

any idea how to fix this? If I manually remove the handles with some other function (bound to clicking on the title or something) and then run my maximizeT function, it gets resized as it should…

Well, removing handles is not the whole story, at least not if I
understand what you’re wanting to do. You say initially you want to
remove the border. Handles are drawn into the border. Hence your
style lines in the functions above should probably be:

+ I ThisWindow (!State 4) WindowStyle !Handles, !Borders

and…

ThisWindow (State 4) WindowStyle Handles, Borders

– Thomas Adam

Well I can’t say I understand it all, just trying to hack some stuff :wink:

anyway. It looks better the way you suggested (both in code and on the desktop) but the main problem remains…
The “Maximize 100 100” still maximizes as if the window had borders, leaving spaces at the right side and bottom.

I’m wondering if the “+ I ThisWindow (!State 4) WindowStyle !Handles, !Borders” doesn’t return some value or updates some size-variable when run inside another function? since it works like it should seperately, for instance binding “!Handles” to Mouse1 directly and then binding the MaximizeT to some other button, then Maximize 100 100 does what it should, leaving no space. Like maximizing an already border/handle-less window.

It’s just one of those days for me. :slight_smile: You are missing UpdateStyles.
Here’s the functions you ought to be using:

DestroyFunc MaximizeT
AddToFunc MaximizeT
+ I ThisWindow (State 4) DoUnMaximize
+ I TestRc (NoMatch) DoMaximize

DestroyFunc DoMaximize
AddToFunc DoMaximize
+ I ThisWindow (!State 4) WindowStyle !Handles, !Borders
+ I State 4 True
+ I UpdateStyles
+ I Maximize 100 100

DestroyFunc DoUnMaximize
AddToFunc DoUnMaximize
+ I ThisWindow (State 4) WindowStyle Handles, Borders
+ I State 4 False
+ I UpdateStyles
+ I Maximize

– Thomas Adam

awesome! now it works perfectly, thanks alot! =)