Use usleep not loop to wait for resize

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@13965 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2002-06-25 03:45:42 +00:00
parent a305830674
commit ef1710f5e7
2 changed files with 21 additions and 10 deletions

View file

@ -1,3 +1,9 @@
2002-06-24 Adam Fedor <fedor@gnu.org>
* Source/x11/XGServerWindow.m ([XGServer -windowdevice:]): Use
usleep instead of loop to wait for resize (rewritten
patch from georg@vhf.de).
Sat Jun 22 14:28:28 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Source/gsc/GSGState.m ([-DPScurrentpoint::]): Use -invert, not

View file

@ -37,6 +37,10 @@
#include <AppKit/NSGraphics.h>
#include <AppKit/NSWindow.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_WRASTER_H
#include "wraster.h"
#else
@ -1344,21 +1348,22 @@ NSDebugLLog(@"Frame", @"X2O %d, %@, %@", win->number,
XFlush (dpy);
XGetGeometry(dpy, window->ident, &window->root,
&x, &y, &width, &height,
&window->border, &window->depth);
/* 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 );
}
if (height != window->siz_hints.height)
{
usleep(1);
XGetGeometry(dpy, window->ident, &window->root,
&x, &y, &width, &height,
&window->border, &window->depth);
}
window->xframe.size.width = width;
window->xframe.size.height = height;