tags 589432 patch
thanks

I've found where the problem arises. Once IceWM issues ConfigureNotify
event to Emacs, the ConfigureNotify handler in Emacs (src/xterm.c)
sets win_gravity in WM_NORMAL_NINTS for Emacs window. IceWM recieves
PropertyNotify event and then calls the following functions (in the
call order):

IceWM receives PropertyNotify:

handleProperty (case XA_WM_NORMAL_HINTS)
updateMwmHints
configureClient
setNormalGeometryInner
updateLayout
setWindowGeometry
performLayout
sendConfigure

sendConfigure() again sends a synthetic ConfigureNotify event to Emacs
and we fall into the infinite loop. The loop can be broken if the
Emacs window gets fullscreen, rolled of iconified (see updateMwmHints
and configureClient "if"'s). Before the icewm-1.3.6, setWindowGeometry
had never sent synthetic ConfigureNotify event.

The question is: why we need to send ConfigureNotify when the
WM_NORMAL_HINTS get changed? I've searched through ICCCM and EWMH for
the cases when the ConfigureNotify synthetic event must be sent to
application. Nothing states that changing of WM_NORMAL_HINTS requires
this event and also the window reconfiguration. The synthetic
ConfigureNotify is requred for window reconfiguration (see 4.1.5,
4.2.3, 4.2.4 in ICCCM). IMO, we shouldn't send ConfigureNotify event
when the WM_NORMAL_HINTS is updated by application.

performLayout() is called also from configure() (src/decorate.cc),
where the body of performLayout() was before icewm-1.3.6. The best
what I can do is to move sendConfigure() from performLayout() back to
the configure(), where it was in pre-1.3.6 times. sendConfigure() only
sends synthetic ConfigureNotify event.

Patch that solves the problem with Emacs is attached.

--- a/decorate.cc	2011-04-16 16:35:25.000000000 +0400
+++ b/decorate.cc	2011-04-16 16:36:53.000000000 +0400
@@ -320,6 +320,7 @@
     YWindow::configure(r);
 
     performLayout();
+    sendConfigure();
 }
 
 void YFrameWindow::performLayout()
@@ -331,8 +332,6 @@
     layoutShape();
     if (affectsWorkArea())
         manager->updateWorkArea();
-
-    sendConfigure();
 }
 
 void YFrameWindow::layoutTitleBar() {

Reply via email to