Hi all,
I've seen various reports on and off over the last few years now (I even
reported on myself a while ago I think -- I can't be arsed to track the post
down though). I think I've finally tracked down why.
It basically boils down to this:
* FVWM grabs the server.
* Call FlushMessageQueue();
* FVWM does what ever it's been asked to do (it wouldn't grab the server
otherwise -- c.f. something like moving a window with an opaqueness
enabled.)
* A Module (any module -- most notably FvwmConsole in my experience) is now
* blocked until the module is ungrabbed -- or moduleTimeout expires.
The problem comes from ModuleTimeout being set to quite high by default (30
seconds, I think) and I wonder in FlushMessageQueue() if it even makes sense
here to timeout on it (we already do so in PositiveWrite() which makes more
sense to there.
Any thoughts? See patch attached, but it's nasty, and I don't want to
commit it as-is. But certainly reducing the timeout to "5" in this case
(conceivably zero would be OK here as well), or any other arbitrary number
solves this sufficiently for me.
So if there's anyone here who's experiences this, can reliably reproduce it,
and can verify this as working, let me know and I'll clean this up a bit
more.
Kindly,
-- Thomas Adam
--
"Deep in my heart I wish I was wrong. But deep in my heart I know I am
not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
diff --git a/fvwm/module_list.c b/fvwm/module_list.c
index 0079953..ea5b5dd 100644
--- a/fvwm/module_list.c
+++ b/fvwm/module_list.c
@@ -964,7 +964,6 @@ static void DeleteMessageQueueBuff(fmodule *module)
void FlushMessageQueue(fmodule *module)
{
- extern int moduleTimeout;
mqueue_object_type *obj;
char *dptr;
int a;
@@ -1002,8 +1001,8 @@ void FlushMessageQueue(fmodule *module)
{
/* Wait until the pipe accepts further
* input */
- timeout.tv_sec = moduleTimeout;
- timeout.tv_usec = 0;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 5;
FD_ZERO(&writeSet);
FD_SET(channel, &writeSet);
rc = fvwmSelect(
@@ -1020,6 +1019,7 @@ void FlushMessageQueue(fmodule *module)
}
if (!FD_ISSET(channel, &writeSet))
{
+#if 0
char *name;
name = get_pipe_name(module);
@@ -1034,7 +1034,7 @@ void FlushMessageQueue(fmodule *module)
name, rc, isTerminated ?
'Y' : 'N');
module_kill(module);
-
+#endif
return;
}