moc window resizes, but only once

Forums:

Under Debian sid I can resize the terminal window (xterm, stterm or screen, i3 or fluxbox) once and moc responds. Any subsequent resizes and nothing happens.

I've tried compiling svn sources locally and recent revisions produce the same as the Debian package. Bisecting, it seems to be r2841 causing problems. How, I'm not sure.

Any hints?

Bisecting, it seems to be r2841 causing problems.

Thanks for putting the effort in to try and isolate the problem to a specific commit.

How, I'm not sure.

No, I can't see anything which would cause an upset either. That commit doesn't change any programming.

Any hints?

I'm currently working on development in the screen interface area so I'll keep an eye open for any stray Pokemons gumming up the works, but if you want to pursue it yourself following the trail from a SIGWINCH might be productive. MOC now logs signals so my first check would be to see if subsequent SIGWINCHs are being received.

There are signals that are not activated.
The workaround is to do so:

diff --git a/trunk/interface.c b/trunk/interface.c index 2737fd5..1863061 100644 --- a/trunk/interface.c +++ b/trunk/interface.c @@ -3526,7 +3526,18 @@ void init_interface (const int sock, const int logging, lists_t_strs *args) signal (SIGINT, sig_interrupt); #ifdef SIGWINCH - signal (SIGWINCH, sig_winch); + //signal (SIGWINCH, sig_winch); + { + + struct sigaction act; + + act.sa_handler = sig_winch; + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + + if (sigaction(SIGWINCH, &act, 0) == -1) + fatal ("sigaction() failed: %s", xstrerror (errno)); + } #endif if (!lists_strs_empty (args)) {

See too:
https://github.com/daltomi/moc-patch/blob/master/0001-Fix-signal-zombie-SIG_CHLD.patch

Yes, the patch above fixes my problems (annoyingly I didn't see the message until I'd made the same patch myself, but I got there in the end...).

When using signal(), the signal handler is removed after it is fired, thus any SIGWINCH'es after the first are never caught by MOC.

Yes, there is a difference in behaviour there introduced by the POSIX change. There are several additional implications to be checked out.

Thanks for the testing, and thanks to "dany" (who should contact mocmaint if he didn't receive my e-mail to him).

A patch based on that above was committed as r2917.