From 5324ab33040e86872af712e7e29364df1b9cf98c Mon Sep 17 00:00:00 2001 From: id Date: Fri, 16 Apr 1999 20:31:26 +0000 Subject: [PATCH] Clean the code. --- src/superfluous.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/superfluous.c b/src/superfluous.c index 5fad30df..6ec38e1b 100644 --- a/src/superfluous.c +++ b/src/superfluous.c @@ -86,39 +86,36 @@ DoKaboom(WScreen *scr, Window win, int x, int y) icon = RCreateImageFromDrawable(scr->rcontext, win, None); if (!icon) return; - - XGrabServer(dpy); - XUnmapWindow(dpy, win); - XSync(dpy, False); - - ximage = XGetImage(dpy, scr->root_win, x, y, w, h, AllPlanes, ZPixmap); - back = RCreateImageFromXImage(scr->rcontext, ximage, NULL); - XDestroyImage(ximage); - if (!back) { - RDestroyImage(icon); - return; - } - + gcv.foreground = scr->white_pixel; gcv.background = scr->black_pixel; gcv.graphics_exposures = False; gcv.subwindow_mode = IncludeInferiors; gc = XCreateGC(dpy, scr->w_win, GCForeground|GCBackground|GCSubwindowMode - |GCGraphicsExposures, &gcv); + |GCGraphicsExposures, &gcv); + + + XGrabServer(dpy); + RConvertImage(scr->rcontext, icon, &pixmap); + XUnmapWindow(dpy, win); + + ximage = XGetImage(dpy, scr->root_win, x, y, w, h, AllPlanes, ZPixmap); + XCopyArea(dpy, pixmap, scr->root_win, gc, 0, 0, w, h, x, y); + XFreePixmap(dpy,pixmap); + + back = RCreateImageFromXImage(scr->rcontext, ximage, NULL); + XDestroyImage(ximage); + if (!back) { + RDestroyImage(icon); + return; + } - /* - XSetClipMask(dpy, scr->copy_gc, None); - */ for (i=0,run=0; iroot_win); - break; - */ } image = RCloneImage(back); RCombineImagesWithOpaqueness(image, icon, @@ -129,9 +126,6 @@ DoKaboom(WScreen *scr, Window win, int x, int y) XFlush(dpy); if(!run) wusleep(1000); } - /* - XClearArea(dpy, scr->root_win, x, y, w, h, False); - */ XFlush(dpy); XUngrabServer(dpy);