diff --git a/ChangeLog b/ChangeLog index 6075ec1..8b4aae3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ * Source/x11/XGServerWindow.m: * Source/x11/XGServerEvent.m: Get backend to generate NSEvent objects with event location given in - OpernStep coordinates. + OpenStep coordinates. Fix flushwindowrect coordinate handling. Update art backend to try to honor the x and y window offsets provided in the graphics state. diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index dabf5ab..e40bbdd 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -2659,6 +2659,7 @@ static BOOL didCreatePixmaps; XGCValues values; unsigned long valuemask; gswindow_device_t *window; + float l, r, t, b; window = WINDOW_WITH_TAG(win); if (win == 0 || window == NULL) @@ -2667,7 +2668,7 @@ static BOOL didCreatePixmaps; return; } - NSDebugLLog(@"XGTrace", @"DPSflushwindowrect: %@ : %d", + NSDebugLLog(@"XGFlush", @"DPSflushwindowrect: %@ : %d", NSStringFromRect(rect), win); if (window->type == NSBackingStoreNonretained) { @@ -2675,23 +2676,20 @@ static BOOL didCreatePixmaps; return; } - /* FIXME: Doesn't take into account any offset added to the window - (from PSsetgcdrawable) or possible scaling (unlikely in X-windows, - but what about other devices?) */ - rect.origin.y = NSHeight(window->xframe) - NSMaxY(rect); - values.function = GXcopy; values.plane_mask = AllPlanes; values.clip_mask = None; valuemask = (GCFunction | GCPlaneMask | GCClipMask); XChangeGC(dpy, window->gc, valuemask, &values); - xi = NSMinX(rect); // width/height seems - yi = NSMinY(rect); // to require +1 pixel - width = NSWidth(rect) + 1; // to copy out - height = NSHeight(rect) + 1; + [self styleoffsets: &l : &r : &t : &b + : window->win_attrs.window_style : window->ident]; + xi = NSMinX(rect) - l; + yi = NSHeight(window->xframe) + b - NSMaxY(rect); + width = NSWidth(rect); + height = NSHeight(rect); - NSDebugLLog (@"NSWindow", + NSDebugLLog (@"XGFlush", @"copy X rect ((%d, %d), (%d, %d))", xi, yi, width, height); if (width > 0 || height > 0) diff --git a/Source/xlib/XGGState.m b/Source/xlib/XGGState.m index 67048ac..a4d38fc 100644 --- a/Source/xlib/XGGState.m +++ b/Source/xlib/XGGState.m @@ -245,6 +245,8 @@ static Region emptyRegion; } XSetRegion(XDPY, xgcntxt, clipregion); +NSDebugLLog(@"XGGraphics", @"Clip %@ set to X rect %@", + self, NSStringFromRect([self clipRect])); } /* Returns the clip region, which must be freed by the caller */ @@ -1485,10 +1487,12 @@ static Region emptyRegion; - (void)DPSrectclip: (float)x : (float)y : (float)w : (float)h { XRectangle xrect; + NSRect orect; CHECK_GC; - xrect = XGViewRectToX(self, NSMakeRect(x, y, w, h)); + orect = NSMakeRect(x, y, w, h); + xrect = XGViewRectToX(self, orect); if (clipregion == 0) { @@ -1522,7 +1526,10 @@ static Region emptyRegion; [self setColor: &fillColor state: COLOR_FILL]; bounds = XGViewRectToX(self, NSMakeRect(x, y, w, h)); - // Hack: Only draw when alpha is not zero +NSDebugLLog(@"XGGraphics", @"Fill %@ X rect %d,%d,%d,%d", + self, bounds.x, bounds.y, bounds.width, bounds.height); + +// Hack: Only draw when alpha is not zero if (drawingAlpha == NO || fillColor.field[AINDEX] != 0.0) XFillRectangle(XDPY, draw, xgcntxt, bounds.x, bounds.y, bounds.width, bounds.height);