rem: if (wwin->flags.selected && !wPreferences.disable_miniwindows)
add: if (wwin->flags.selected && !wPreferences.disable_miniwindows #ifdef NETWM_HINTS && !wwin->flags.net_handle_icon #endif )
context: wIconifyWindow(WWindow *wwin){    XWindowAttributes attribs;    int present;    if (!XGetWindowAttributes(dpy, wwin->client_win, &attribs)) {        /* the window doesn't exist anymore */        return;    }    if (wwin->flags.miniaturized) {        return;    }    if (wwin->transient_for!=None &&        wwin->transient_for!=wwin->screen_ptr->root_win) {        WWindow *owner = wWindowFor(wwin->transient_for);        if (owner && owner->flags.miniaturized)            return;    }    present = wwin->frame->workspace==wwin->screen_ptr->current_workspace;    /* if the window is in another workspace, simplify process */    if (present) {        /* icon creation may take a while */        XGrabPointer(dpy, wwin->screen_ptr->root_win, False,                     ButtonMotionMask|ButtonReleaseMask, GrabModeAsync,                     GrabModeAsync, None, None, CurrentTime);    }    if (!wPreferences.disable_miniwindows) {        if (!wwin->flags.icon_moved) {            PlaceIcon(wwin->screen_ptr, &wwin->icon_x, &wwin->icon_y, wGetHeadForWindow(wwin));        }        wwin->icon = wIconCreate(wwin);        wwin->icon->mapped = 1;    }    wwin->flags.miniaturized = 1;    wwin->flags.mapped = 0;    /* unmap transients */    unmapTransientsFor(wwin);    if (present) {        wSoundPlay(WSOUND_ICONIFY);        XUngrabPointer(dpy, CurrentTime);        wWindowUnmap(wwin);        /* let all Expose events arrive so that we can repaint         * something before the animation starts (and the server is grabbed) */        XSync(dpy, 0);        if (wPreferences.disable_miniwindows)            wClientSetState(wwin, IconicState, None);        else            wClientSetState(wwin, IconicState, wwin->icon->icon_win);        flushExpose();#ifdef ANIMATIONS        if (!wwin->screen_ptr->flags.startup && !wwin->flags.skip_next_animation            && !wPreferences.no_animations) {            int ix, iy, iw, ih;            if (!wPreferences.disable_miniwindows) {                ix = wwin->icon_x;                iy = wwin->icon_y;                iw = wwin->icon->core->width;                ih = wwin->icon->core->height;            } else {#ifdef KWM_HINTS                WArea area;                if (wKWMGetIconGeometry(wwin, &area)) {                    ix = area.x1;                    iy = area.y1;                    iw = area.x2 - ix;                    ih = area.y2 - iy;                } else#endif /* KWM_HINTS */                {                    ix = 0;                    iy = 0;                    iw = wwin->screen_ptr->scr_width;                    ih = wwin->screen_ptr->scr_height;                }            }            animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y,                          wwin->frame->core->width, wwin->frame->core->height,                          ix, iy, iw, ih, False);        }#endif    }    wwin->flags.skip_next_animation = 0;    if (!wPreferences.disable_miniwindows) {        if (wwin->screen_ptr->current_workspace==wwin->frame->workspace ||            IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)            XMapWindow(dpy, wwin->icon->core->window);        AddToStackList(wwin->icon->core);        wLowerFrame(wwin->icon->core);    }    if (present) {        WWindow *owner = recursiveTransientFor(wwin->screen_ptr->focused_window);        /*         * It doesn't seem to be working and causes button event hangup         * when deiconifying a transient window.         setupIconGrabs(wwin->icon);         */        if ((wwin->flags.focused             || (owner && wwin->client_win == owner->client_win))            && wPreferences.focus_mode==WKF_CLICK) {            WWindow *tmp;            tmp = wwin->prev;            while (tmp) {                if (!WFLAGP(tmp, no_focusable)                    && !(tmp->flags.hidden||tmp->flags.miniaturized)                    && (wwin->frame->workspace == tmp->frame->workspace))                    break;                tmp = tmp->prev;            }            wSetFocusTo(wwin->screen_ptr, tmp);        } else if (wPreferences.focus_mode!=WKF_CLICK) {            wSetFocusTo(wwin->screen_ptr, NULL);        }#ifdef ANIMATIONS        if (!wwin->screen_ptr->flags.startup) {            Window clientwin = wwin->client_win;            XSync(dpy, 0);            processEvents(XPending(dpy));            /* the window can disappear while doing the processEvents() */            if (!wWindowFor(clientwin))                return;        }#endif    }    if (wwin->flags.selected && !wPreferences.disable_miniwindows)        wIconSelect(wwin->icon);    WMPostNotificationName(WMNChangedState, wwin, "iconify");}