From c0df36607bbdebbeac56559ad92c1475fcfe50eb Mon Sep 17 00:00:00 2001 From: xgl Date: Sat, 7 Mar 2009 20:47:55 +0000 Subject: [PATCH] Fix a bug (from rev.28036) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@28049 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/x11/XGServerEvent.m | 23 ++++++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe6fc20..f88210d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-07 Xavier Glattard + + * Source/x11/XGServerEvent.m: + Fix a bug (from rev.28036) and consolidate the computing of expose rectangle + of subwindows. + 2009-03-06 Xavier Glattard * Source/x11/XGGLFormat.m: diff --git a/Source/x11/XGServerEvent.m b/Source/x11/XGServerEvent.m index 1cc8842..996dee7 100644 --- a/Source/x11/XGServerEvent.m +++ b/Source/x11/XGServerEvent.m @@ -958,7 +958,7 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) NSDebugLLog(@"NSEvent", @"%d Expose\n", xEvent.xexpose.window); { - BOOL isSubWindow; + BOOL isSubWindow = NO; if (cWin == 0 || xEvent.xexpose.window != cWin->ident) { @@ -969,9 +969,14 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) { Window xw; xw = xEvent.xexpose.window; + XWindowAttributes wa; + // We should not found more than one level, but who knows ? while (cWin == 0) { Window rw, *cw; unsigned int nc; + XGetWindowAttributes(dpy,xEvent.xexpose.window,&wa); + xEvent.xexpose.x += wa.x; + xEvent.xexpose.y += wa.y; if ( !XQueryTree(dpy, xw, &rw, &xw, &cw, &nc) ) continue; if ( cw != NULL ) @@ -989,20 +994,8 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) { XRectangle rectangle; - if ( !isSubWindow ) - { - rectangle.x = xEvent.xexpose.x; - rectangle.y = xEvent.xexpose.y; - } - else - { - // assume no border - XWindowAttributes wa; - XGetWindowAttributes(dpy,xEvent.xexpose.window,&wa); - rectangle.x = xEvent.xexpose.x+wa.x; - rectangle.y = xEvent.xexpose.y+wa.y; - } - + rectangle.x = xEvent.xexpose.x; + rectangle.y = xEvent.xexpose.y; rectangle.width = xEvent.xexpose.width; rectangle.height = xEvent.xexpose.height;