Hi, here is a patch that fixes an occasional problem with displaced drawing of (the items of) menus and popup menus. The problem turned up especially if menu items were removed. The patch replaces a hack in the X backend code which doesn't do it too well. I played around with the problem and finally replaced the hack with a usleep(1) - that did it :-)
Georg 2002-06-11 Georg Fleischmann * back/Source/x11/XGServerWindow.m [XGServerWindow windowDevice]: use usleep(1) to wait for X Server *** back/Source/x11/XGServerWindow.m.old Tue Jun 11 20:46:25 2002 --- back/Source/x11/XGServerWindow.m Tue Jun 11 21:00:01 2002 *************** *** 24,29 **** --- 24,32 ---- #include "config.h" #include <math.h> + #ifdef HAVE_UNISTD_H + #include <unistd.h> + #endif #include <Foundation/NSString.h> #include <Foundation/NSArray.h> #include <Foundation/NSValue.h> *************** *** 1344,1364 **** XFlush (dpy); ! /* hack: ! * wait until a resize of window is finished (especially for NSMenu) ! * is there any way to wait until X finished it's stuff? ! * XSync(), XFlush() doesn't do the job! ! */ ! { ! int i = 0; ! do ! { ! XGetGeometry(dpy, window->ident, &window->root, ! &x, &y, &width, &height, ! &window->border, &window->depth); ! } ! while( i++<10 && height != window->siz_hints.height ); ! } window->xframe.size.width = width; window->xframe.size.height = height; --- 1347,1357 ---- XFlush (dpy); ! usleep(1); // wait until X Server finished resizing the window ! XGetGeometry(dpy, window->ident, &window->root, ! &x, &y, &width, &height, ! &window->border, &window->depth); ! window->xframe.size.width = width; window->xframe.size.height = height; _______________________________________________ Bug-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gnustep