Trouble setting up Fvwm function[SOLVED]

Hello! I am having trouble setting up my function.

I want to press Super-Up to maximize if window is not maximized. If window is maximized Super-Up should do nothing.

I want to press Super-Down to unmaximize if window is maximized. If window is not maximized, Super-Down should Iconify.

So, this is what I have:

Key	Down	A	4	KoggleMinimize
Key	Up		A	4	KoggleMaximize

DestroyFunc KoggleMaximize
AddToFunc KoggleMaximize
+ I Current (!Maximized) Maximize 

DestroyFunc KoggleMinimize
AddToFunc KoggleMinimize
+ I Current (Maximized) Maximize
+ I Current (!Maximized) Iconify

However, unfortunately for me, this doesn’t work at all and actually freezes up my desktop. I am using version 2.6.5 as found in the Debian repository. Hoping someone can point me in the right direction?

Thank you, have a nice day!

I think it’s working now. I don’t know why or how but I think it’s ok. Thank you, have a nice day!

DestroyFunc KoggleMaximize
AddToFunc KoggleMaximize
+ I ThisWindow (!Maximized) Maximize
+ I ThisWindow (Maximized) Nop
 
DestroyFunc KoggleMinimize
AddToFunc KoggleMinimize
+ I ThisWindow (!Maximized) Iconify
+ I ThisWindow (Maximized) Maximize

Just kidding it’s not working after all. I don’t know what wrong but whatever I do, Super-Down causes my fvwm to freeze up. I’ve tried keybinding it to something else, changing the function of Super-Down, whatever I can think of, but my window manager keeps freezing up when I try setting up this functionality.

It has something to do with my setup, because when I use the autogenerated fvwm2rc and add my functions to it, everything’s fine. This is my personal rc file-

DeskTopSize 1x1
IgnoreModifiers L25
Style *           ClickToFocus
#Style *                NoTitle
#Style *           !Handles !Borders 
Style * NoIcon
Key Space       A       M       Menu WindowMenu
Key Space       A       4       Menu RootMenu
Key Down        A       M       KoggleMinimize
Key j           A       4       Iconify
Key Up          A       M       KoggleMaximize
Key k           A       4       Maximize
Key Tab A M WindowList Root c c NoGeometry, CurrentAtEnd, IconifiedAtEnd
Mouse 1 R       A       Menu RootMenu Nop
Mouse 1 1       A       Menu WindowMenu
Mouse 1 6       A       Iconify
Mouse 1 4       A       Maximize
Mouse 1 2       A       Close
Mouse 1 FTS       A       FuncFvwmResizeOrRaise
Mouse 1 T      A       FuncFvwmMoveOrRaise
Mouse 1 W      M       FuncFvwmMoveOrRaise
Mouse 3 W      M       FuncFvwmResizeOrRaise
Mouse 1 I       A       FuncFvwmMoveOrIconify
DestroyMenu RootMenu
AddToMenu RootMenu
+                       "&1. XTerm"             Exec exec xterm
+                       "&2. Firefox"              Exec exec firefox
+                       "&3. VLC"              Exec exec vlc
+                       "&R. Restart FVWM"      Restart
DestroyMenu WindowMenu
AddToMenu WindowMenu
+  "$[gt.&Move]"              Move
+  "$[gt.&Resize]"            Resize
+  "$[gt.Mi&nimize]"       Iconify
+  "$[gt.Ma&ximize]"      Maximize
+  "$[gt.&Close]"             Close
DestroyFunc WindowListFunc
AddToFunc WindowListFunc
+ I Iconify off
+ I FlipFocus
+ I Raise
DestroyFunc FuncFvwmMoveOrRaise
AddToFunc FuncFvwmMoveOrRaise
+ I Raise
+ M Move
+ D Lower
DestroyFunc FuncFvwmMaximize
AddToFunc FuncFvwmMaximize
+ M Maximize   0 100
+ H Maximize   0 100
+ C Maximize   0  80
+ D Maximize 100 100
DestroyFunc FuncFvwmMoveOrIconify
AddToFunc FuncFvwmMoveOrIconify
+ I Raise
+ M Move
+ D Iconify
DestroyFunc FuncFvwmResizeOrRaise
AddToFunc FuncFvwmResizeOrRaise
+ I Raise
+ M Resize
+ D Lower

DestroyFunc WindowLudoResize
AddToFunc WindowLudoResize
+ M Resize direction SE

DestroyFunc KoggleMaximize
AddToFunc KoggleMaximize
+ I ThisWindow (!Maximized) Maximize
+ I ThisWindow (Maximized) Nop

DestroyFunc KoggleMinimize
AddToFunc KoggleMinimize
+ I Iconify
#+ I ThisWindow (Maximized) Maximize


+ M Resize direction SE
Mouse 3 W M Function WindowLudoResize

Key Left        A       4       TileLeft
DestroyFunc TileLeft
AddToFunc TileLeft
+ I Maximize 50 100


Key Right       A       4       TileRight
DestroyFunc TileRight
AddToFunc TileRight
+ I Maximize 50 100
+ I Move 50 0

EDIT I would delete this thread if I could. Idk what the problem was but it must have been something in the rc file - I’m starting with a blank rc file and building up from there and I’m not have the freezing issue anymore.

try [code]
DestroyFunc UnmaximizeOrIconify
AddToFunc UnmaximizeOrIconify

  • I ThisWindow (Maximized) Maximize False
  • I TestRc (!Match) Iconify[/code]

works for me.

Thank you! I think it wasn’t so much the function, but something conflicting in my configuration file. Have a nice day!

Rippard, I see that in the “KoggleMinimize” function that made your FVWM hang, you had between (!) the “+” lines defining the function a comment “#” followed by a few empty lines. It looks like this confused your FVWM. However it should not freeze, this is still a bug. Could you please figure out what precisely disturbs FVWM (the comment? the blank lines? both in combination?) and report this on one of the mailing lists?

No, please don’t. There’s nothing wrong with that function or the way it has been written.

The + command is cumulative with respect to the last AddToFunc, AddToDecor or AddtoMenu command used. You can have as much whitespace in the configuration file as you like; it won’t make a difference.

FVWM can “hang” for a few reasons:

  • Actions aren’t in a window-context so FVWM blocks asking for one (See, for instance: NoWindow Close);
  • PipeRead

– Thomas Adam