Toggle Borders and Title

Call me stupid, but I don’t find it in the forum, it must be here…

I have a “Window Ops” Menu and I wan’t to incorporate “Toggle [Borders|Title]” into it. Is there a Toggle function for that purpose?
I suspect I have to write at least one or extend an exisiting one.

PS.: I don’t get it. How do I instruct fvwm to omit Title and Borders on maximized windows?

Kind Regards, Konsti

There is if you use the patches I wrote to do this. Details here:

Then you can do things like:

ThisWindow (HasTitle) WindowStyle !Title
ThisWindow (HasTitle, HasBorders) WindowStyle !Borders

– Thomas Adam

I did this a while back. I had to use states to keep track of whether a window was titled, bordered, both or neither.

[code]DestroyFunc ToggleTitle
AddToFunc ToggleTitle

  • I Pick (State 0) WindowStyle Title
  • I TestRc (NoMatch) WindowStyle !Title
  • I State 0

DestroyFunc ToggleBorder
AddToFunc ToggleBorder

  • I Pick (State 1) WindowStyle Borders
  • I TestRc (NoMatch) WindowStyle !Borders
  • I State 1

Ok, the latter functions work well.
I really don’t want to patch something here in the code, because if I have to do this on at least three machines rollseyes

Okay, so the “!Borders, !Title when maximising and vice versa”, how could I do this?
I see now this is a complete other topic than toggle…

You need a custom maximize func. Fiddle with this a bit…

[code]DestroyFunc MyMax
AddToFunc MyMax

  • I ThisWindow (Maximized) WindowStyle Borders, Title
  • I TestRc (NoMatch) WindowStyle !Borders, !Title
  • I Maximize

You may well benefit from adding + I UpdateStyles after the windowstyle before you maximize. This is also mentioned in the #fvwm channel FAQ.

– Thomas Adam

The “+ I UpdateStyles”
seems even to be required!
I fiddled a bit without and MyMax only Maximized andomiited a couple of pixels
which the app could be more maximized. Rather than simple Maximize…

Argh What a pity. MyMax doesn’t maximize over the last ~20 pixels at the bottom and a couple of pixels to the right. :confused:

Are you maxing shell windows? I know my aterms will only grow in increments of line and column size; so it my font is 20 pixels tall, I can only adjust the height of a headless borderless aterm in 20px units. It’s a pain because, depending on the wallpaper, it can mess the effect up, but I’ve learned to live with it.

I don’t think it’s UpdateStyles either, because I used naked-by-default terminals, and only add title or border if I have a specific reason. So I use plain old Maximize for my window ops. (That’s not to say it’s not useful for your purposes, just I don’t think it’s the cause of the problem).

If you find a workaround for this one, I’d be interested to hear about it, but I think it’s the by-design behaviour of my terms

The other thing that can happen is if you max a window and then toggle the title or border, it no longer fits properly. But the func I posted changes style first and then (un)maximises - so that shouldn’t be an issue.

It gets a little more complicated than that. So I’ll explain.

You’re right when you speak of resize-hint dependant applications. But the problem is exacerbated because of the geometry of the window. Consider what happens when a function runs. If you remove the decorations before they’re updated, the geometry is assumed to be the client window, which is of course less when the decorations are removed. So it has to be updated prior to the maximization.

– Thomas Adam

No, I know this behaviour of shell windows only maximing int increments of column and line size (IIRC there is one doing this other, gnome-terminal or konsole?).

You know what? You are right. Your function works. I simply exchanged my running fvwm and the one on Xnest :angry:
The Xnest one did right and I forgot to restart the main one when testing it there.

For the column/row ‘problem’ with terminals you can use the “ResizeHintOverride” style, like

Style aterm ResizeHintOverride

Thank you kind sir, that works nicelty :smiley: