display the mini icon of the active window

Hi,

I’m making an fvwmbutton bar and I want to include a place where the icon of the active window (the one that has the focus) is shown.

How can I do this?

if it’s possible, I’d like to do the same with the name of the window.

The reason I want to do this is that I want to attach windowspecific menu’s to these things

thanks in advance

Johan

You can adapt the following:

edulinux.homeunix.org/fvwm/fvwmc … aq.html#M1

Essentially you will need to give whichever button you want to change an Id. Here’s a contrived example:

DestroyModuleConfig FB: *
*FB: Rows 1
*FB: Columns 1
*FB: (1x1, Id "MyButton")

Module FvwmButtons FB

There’s your button. In order for that button to inherit the necessary properties, you can use FvwmEvent with the focus_change event. Hence:

DestroyModuleConfig FE: *
*FE: Cmd Function
*FE: focus_change updateButton

Module FvwmEvent FE

Each time there’s a change in focus, that event will get called, which in turn will call the updateButton function. It’s this function which will do all the work for us.

DestroyFunc updateButton
AddToFunc   updateButton
+ I Current SendToModule FB ChangeButton MyButton Title $[w.name]
+ I Current SendToModule FB ChangeButton MyButton Icon $[w.miniiconfile]

So all that does is it changes both parts of the button – the title and the icon, depending on which window has the focus. As a test case, here’s what I did:

Style Firefox-bin EWMHMiniIconOverride, MiniIcon Mosaic.xpm
Style FvwmConsole MiniIcon mutate.xpm

Works fine.

– Thomas Adam

Thank you very much. Works perfectly

Johan