I have a trouble with panel in relation to fullscreen

I have a panel made with FvwmButtons, which has the style StaysOnTop and this ends up rendering it over even a fullscreened window. I have tried to fiddle with the layers, but as soon as the panel is on a layer where it always renders on top of an application it will also render on top of a fullscreened window. Is there any way to make a fullscreened window automatically render on top of the panel?

I have seen another thread where they binded the F11 key to a function, but I want this to automatically happen whenever something like youtube wants to go fullscreen. Is this possible, perhaps with FvwmEvent, or is it only possible through key bindings?

You should be able to use FvwmEvent for this. Put your panel on Layer 5 (usually layer 6 is the StaysOnTop layer and layer 4 is the default layer). Then when a window becomes full screen move it to Layer 6 via the StaysOnTop style, and back with StaysPut (layer 4). I don’t see an event for maximize/fullscreen, but I think the event, property_change might trigger (you may have to test things a bit). You can then have to run a function something like:

DestroyFunc ToggleMaximizeLayer
AddToFunc ToggleMaximizeLayer
+ I ThisWindow (Maximzed, AcceptsFocus, CurrentPage) WindowStyle StaysOnTop
+ I ThisWindow (!Maximized, AcceptsFocus, CurrentPage) WindowStyle StaysPut

I haven’t tested this, but the AcceptsFocus (or maybe CirculateHit) are to keep your panel or other windows from being affected by this if they have any property_change.

Thanks for this. I will have to read up on how to use FvwmEvent, but this makes me believe it is possible to do this

I have done a little bit of testing, and property_change seems to be activated at seemingly random times. What I can say for sure is that it doesn’t seem to be activated on entering fullscreen.
Do you have any idea of anything else that could work?

Yea, it appears that property_change doesn’t detect maximize, seems there is no event for this.

The event would have been nice because it can work no matter how a window becomes full screen, if this isn’t an option, you’ll have to write your own custom maximize function (note maximize can trigger the fullscreen flag).

DestroyFunc MyToggleFullscreen
AddToFunc MyToggleFullscreen
+ I ThisWindow (Maximized) MyFullscreenOff
+ I TestRc (NoMatch) MyFullscreenOn

DestroyFunc MyFullscreenOn
AddToFunc MyFullscreenOn
+ I Maximize fullscreen true
+ I WindowStyle StaysOnTop

DestroyFunc MyFullscreenOff
AddToFunc MyFullscreenOff
+ I Maximize fullscreen off
+ I WindowStyle StaysPut

Bind this to a key/menu and you can use it to toggle fullscreen on/off, and when that happens it will change the layer to raise it above/below your panel on layer 5.

I was really hoping I was able to automate this, so this feels like a loss to me. Thanks for the help though