multiple instances of an FvwmEvent without complex function?

I would like to catch a few add_window events in my config, however I can’t use a complex function, due to another issue:
(see viewtopic.php?t=1579&highlight=)

It seems that the config will only honor the last event of this type that is enetered. For example, in this function only the xterm Move is honored:

# FvwmEvent can bind Commands to Events DestroyModuleConfig FvwmEvent: * *FvwmEvent: deiconify DeThumbnail *FvwmEvent: add_window NewWindowFunc *FvwmEvent: add_window "ThisWindow (Login) Move -0p 0p" *FvwmEvent: add_window "ThisWindow (xterm) Move 0p 0p"

Is there any other way to do specify multiple add_window checks without the use of a complex function? If not, is there anyway to prevent the new function from grabbing the pointer?

You can have multiple FvwmEvents with different aliases. Or you could try to do a single test excluding all windows that you don’t want your function to run on for various reasons.

For example you can set state 0 on all windows you don’t want to run the command on with matching styles. Then

*FvwmEvent: add_window "ThisWindow (!State 0) NewWindowFunc)

But the right thing would be to fix your application. You could for instance query the pointer on the leave events to check that it really has left the button or grab the pointer yourself before showing the window. Or depending on the type of window you are to show you might want to use an override redirect window.

If you ever intend to distribute such an application you would want it working with several window managers and configurations, and relying on that nobody grabs the pointer while your window is shown isn’t a good solution.

I may have some time to re-tune the app in the future, but it seems that the issues only occur in FVWM, which is my most used WM, so I wanted it to work nice on my system.

I didn’t know about some of the things you mentioned, like override redirect windows, so I’ll need to look into them more.

I think the most immediate solution is to use FvwmEvent aliases. I tried this yesterday, but I messed up it’s initialilization. I can put multiple things like this in the config:

DestroyModuleConfig FE-xclock-move: * *FE-xclock-move: add_window "ThisWindow (xclock) Move 0p -0p" Module FvwmEvent FE-xclock-move

For people looking at this in the future, there are two gotchas with this:

  1. you can use the - but not the _ character in the alias name
  2. The Module FvwmEvent FE-xclock-move needs to be out in the config, I had originally put it in my start function

Is this an application you’re writing yourself? If so, have a look at the manpage for XSetWindowAttributes, given this function sets things like override_redirect.

If it’s not an application you’re writing, or can’t edit the source, or whatever, and you don’t want FVWM to manage the window, look at the Unmanaged style option.


– Thomas Adam

Thanks Thomas. I actually came across that article while searchcing, and it solved my problem.

This is an app I’m developing myself, however it is a GTK based app, so I think I may start looking into GDK windows. This particular window is a GTKWindow, but I have never really been happy with it, so I may rewrite some things. I didn’t know about the Unmanaged style option (every time I post here I learn a bunch of new things). This seems like the best option for a workaround right now.