From 4932433b95a3da3eedd0ba12d7d7782c681f64d0 Mon Sep 17 00:00:00 2001 From: "Carlos R. Mafra" Date: Sat, 17 Oct 2009 01:56:28 +0200 Subject: [PATCH] Remove DEMATERIALIZE_ICON code This animation is not as cool as the NORMAL_ICON_KABOON, so I don't think having a choice here is justified. Let's remove this option (it was not defined in wconfig.h.in by default) and keep using the nicer NORMAL_ICON_KABOON. --- src/appicon.c | 15 ---------- src/superfluous.c | 72 ----------------------------------------------- src/wconfig.h.in | 16 +---------- 3 files changed, 1 insertion(+), 102 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index 37c9171d..d4b98a9a 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -106,14 +106,6 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char *command, char *wm_instance, wXDNDMakeAwareness(dicon->icon->core->window); #endif -#ifdef DEMATERIALIZE_ICON - { - XSetWindowAttributes attribs; - attribs.save_under = True; - XChangeWindowAttributes(dpy, dicon->icon->core->window, CWSaveUnder, &attribs); - } -#endif - /* will be overriden by dock */ dicon->icon->core->descriptor.handle_mousedown = appIconMouseDown; dicon->icon->core->descriptor.handle_expose = iconExpose; @@ -149,13 +141,6 @@ WAppIcon *wAppIconCreate(WWindow * leader_win) aicon->wm_instance = wstrdup(leader_win->wm_instance); aicon->icon = wIconCreate(leader_win); -#ifdef DEMATERIALIZE_ICON - { - XSetWindowAttributes attribs; - attribs.save_under = True; - XChangeWindowAttributes(dpy, aicon->icon->core->window, CWSaveUnder, &attribs); - } -#endif #ifdef XDND wXDNDMakeAwareness(aicon->icon->core->window); #endif diff --git a/src/superfluous.c b/src/superfluous.c index dff3a61c..82cb28bb 100644 --- a/src/superfluous.c +++ b/src/superfluous.c @@ -45,78 +45,6 @@ extern WPreferences wPreferences; -#ifdef DEMATERIALIZE_ICON -void DoKaboom(WScreen * scr, Window win, int x, int y) -{ - RImage *icon; - RImage *back; - RImage *image; - Pixmap pixmap; - XImage *ximage; - GC gc; - XGCValues gcv; - int i; - int w, h; - int run; - XEvent event; - - h = w = wPreferences.icon_size; - if (x < 0 || x + w > scr->scr_width || y < 0 || y + h > scr->scr_height) - return; - - icon = RCreateImageFromDrawable(scr->rcontext, win, None); - if (!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); - - 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) { - RReleaseImage(icon); - return; - } - - for (i = 0, run = 0; i < DEMATERIALIZE_STEPS; i++) { - XEvent foo; - if (!run && XCheckTypedEvent(dpy, ButtonPress, &foo)) { - run = 1; - XPutBackEvent(dpy, &foo); - } - image = RCloneImage(back); - RCombineImagesWithOpaqueness(image, icon, - (DEMATERIALIZE_STEPS - 1 - i) * 256 / (DEMATERIALIZE_STEPS + 2)); - RConvertImage(scr->rcontext, image, &pixmap); - XCopyArea(dpy, pixmap, scr->root_win, gc, 0, 0, w, h, x, y); - XFreePixmap(dpy, pixmap); - XFlush(dpy); - if (!run) - wusleep(1000); - } - - while (XCheckTypedEvent(dpy, MotionNotify, &event)) { - } - XFlush(dpy); - - XUngrabServer(dpy); - XFreeGC(dpy, gc); - RReleaseImage(icon); - RReleaseImage(back); -} -#endif /* DEMATERIALIZE_ICON */ - #ifdef NORMAL_ICON_KABOOM void DoKaboom(WScreen * scr, Window win, int x, int y) { diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 565396ec..f37dc048 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -125,14 +125,7 @@ */ #undef SHADOW_RESIZEBAR -/* - * Define DEMATERIALIZE_ICON if you want the undocked icon animation - * to be a progressive disaparison animation. - * This will cause all application icons to be created with Save Under - * enable. - */ -#undef DEMATERIALIZE_ICON - +#define NORMAL_ICON_KABOOM /* * Define ICON_KABOOM_EXTRA if you want extra fancy icon undocking * explosion animation. @@ -316,9 +309,6 @@ #define WORKSPACE_NAME_DELAY 400 -/* number of steps for icon dematerialization. */ -#define DEMATERIALIZE_STEPS 16 - /* Delay when cycling colors of selected icons. */ #define COLOR_CYCLE_DELAY 200 @@ -437,10 +427,6 @@ #undef LANGUAGE_SK #endif -#ifndef DEMATERIALIZE_ICON -#define NORMAL_ICON_KABOOM -#endif - #if defined(HAVE_LIBINTL_H) && defined(I18N) #include #define _(text) gettext(text)