I recently installed a text editor (one that's not openly available) on my home Arch Linux system running icewm. This is a text editor that my department uses daily at work and its author is someone I work with on a regular basis. It uses only Xlib to communicate with X windows. After installing this editor, I quickly noticed some odd behaviors and found some features that weren't working right. After discussing the symptoms with the author, he said that it sounded like it was getting way too many X events and had me enable some debugging code that prints a message for every X event the program receives.
Here is the debug code:
if(XEvent_a.type!=KeyPress)
{
printf("++++XEvent_a.type=%i ",XEvent_a.type);
if (XEvent_a.type==KeyPress) printf("KeyPress\n");
if (XEvent_a.type==KeyRelease) printf("KeyRelease\n");
if (XEvent_a.type==ButtonPress) printf("ButtonPress\n");
if (XEvent_a.type==ButtonRelease) printf("ButtonRelease\n");
if (XEvent_a.type==MotionNotify) printf("MotionNotify\n");
if (XEvent_a.type==EnterNotify) printf("EnterNotify\n");
if (XEvent_a.type==LeaveNotify) printf("LeaveNotify\n");
if (XEvent_a.type==FocusIn) printf("FocusIn\n");
if (XEvent_a.type==FocusOut) printf("FocusOut\n");
if (XEvent_a.type==KeymapNotify) printf("KeymapNotify\n");
if (XEvent_a.type==Expose) printf("Expose\n");
if (XEvent_a.type==GraphicsExpose) printf("GraphicsExpose\n");
if (XEvent_a.type==NoExpose) printf("NoExpose\n");
if (XEvent_a.type==CirculateRequest) printf("CirculateRequest\n");
if (XEvent_a.type==ConfigureRequest) printf("ConfigureRequest\n");
if (XEvent_a.type==MapRequest) printf("MapRequest\n");
if (XEvent_a.type==ResizeRequest) printf("ResizeRequest\n");
if (XEvent_a.type==CirculateNotify) printf("CirculateNotify\n");
if (XEvent_a.type==ConfigureNotify) printf("ConfigureNotify (move or resize)\n");
if (XEvent_a.type==CreateNotify) printf("CreateNotify\n");
if (XEvent_a.type==DestroyNotify) printf("DestroyNotify\n");
if (XEvent_a.type==GravityNotify) printf("GravityNotify\n");
if (XEvent_a.type==MapNotify) printf("MapNotify (mwmRestt3 or deiconify)\n");
if (XEvent_a.type==MappingNotify) printf("MappingNotify\n");
if (XEvent_a.type==ReparentNotify) printf("ReparentNotify (mwmRestt2)\n");
if (XEvent_a.type==UnmapNotify) printf("UnmapNotify (mwmRestt1 or inconify)\n");
if (XEvent_a.type==VisibilityNotify) printf("VisibilityNotify\n");
if (XEvent_a.type==ColormapNotify) printf("ColormapNotify\n");
if (XEvent_a.type==SelectionRequest) printf("SelectionRequest\n");
if (XEvent_a.type==SelectionNotify) printf("SelectionNotify\n");
if (XEvent_a.type==SelectionClear) printf("SelectionClear\n");
}
When I start the editor from an xterm window, it immediately issues a continuous stream of these messages:
++++XEvent_a.type=22 ConfigureNotify (move or resize)
++++XEvent_a.type=22 ConfigureNotify (move or resize)
++++XEvent_a.type=22 ConfigureNotify (move or resize)
... ad infinitum
This is without trying to move the window or resize it. The program gets roughly 100 of these X events per second. I have tried this test when running 4 different window managers: icewm, twm, mwm, and gnome/metacity on two different Linux systems: Arch Linux 32-bit and RHEL6. Only icewm exhibits this behavior and it behaves the same on both operating systems. twm and mwm don't send a move/resize event to the editor until I more or resize the window. gnome/metacity issues one move/resize event on program startup and then a series of these events when I move the window. icewm spews out these events continuously on program startup.
This appears to be a bug in icewm. Or, perhaps I am not using it correctly.
should be fixed in next release