Hi Dominik et al,

This post follows on from the previous "ModuleListenOnly command"
which was getting a bit off-topic.

> > As a hack/compromise, maybe we could modify AddToFunc to keep track
> > of whether or not it uses a "mouse modifier" & only then grab the
> > X server, in execute_complex_function().
> 
> We discussed this a couple of years ago, and Olivier(?) suggested
> to allow functions without grabbing.  The problem is that it is
> generally unpredictable which functions need to grab and which do
> not, and you can't do it on the fly because its too late then.

I see.

I read the thread (posted by Thomas) & now I understand that the
grab is necessary for more than just the use of mouse modifiers, &
I agree that it's near-impossible to calculate in advance whether
we need to do a grab before we execute a complex function.

As an author of complex functions, though, I sometimes know I do
_not_ want FVWM to perform a grab when it executes my complex
function. Would anyone be adverse to allowing the user to specify
when they do not want a grab to be performed?

Dan suggested something like this in:

http://www.mail-archive.com/fvwm@lists.math.uh.edu/msg10120.html

I'm not so keen on adding 'Grab' & 'Ungrab' builtin commands. (It's
not too hard to image novice users regularly causing FVWM to freeze,
through misuse of such commands.) But I like the idea of specifying
a function as being "NoGrab".

Dan proposed "FunctionNoGrab FUNCNAME".

Another way to do it would be:

AddToFunc MyFunc NoGrab I Echo hello
+ I Echo world

but I think this a bit unintuitive/hackish.

Instead, I propose adding a separate builtin command, "DefineFunc":

DefineFunc MyFunc NoGrab
+ I Echo hello
+ I Echo world

DefineFunc would behave much like AddToFunc except for 3 differences:
1. It would generate a warning message if the function already existed.
2. It would _not_ accept an action.
3. It would accept a list of _optional_ "function options". To start
   with, the only option would be "NoGrab".

We could actually modify AddToFunc in this way, but (2) is a rather
significant interface change & could upset a lot of users.

Note that use of DefineFunc wouldn't be mandatory (though we could
easily detect if it wasn't used & generate a "deprecated" warning if
we wanted to) & it doesn't change the behaviour of existing configs.
(ie. functions defined soley using "AddToFunc")

What do you think?

SCoTT. :)

Reply via email to