rem: wSelectWindow(icon->owner);
add: wSelectWindow(icon->owner, !wwin->flags.selected);
context: miniwindowMouseDown(WObjDescriptor *desc, XEvent *event){    WIcon *icon = desc->parent;    WWindow *wwin = icon->owner;    XEvent ev;    int x=wwin->icon_x, y=wwin->icon_y;    int dx=event->xbutton.x, dy=event->xbutton.y;    int grabbed=0;    int clickButton=event->xbutton.button;        if (IsDoubleClick(icon->core->screen_ptr, event)) {	miniwindowDblClick(desc, event);	return;    }    #ifdef DEBUG    puts("Moving miniwindow");#endif    if (event->xbutton.button==Button1) {		if (event->xbutton.state & MOD_MASK)	    wLowerFrame(icon->core);	else	    wRaiseFrame(icon->core);        if (event->xbutton.state & ShiftMask) {            wIconSelect(icon);            wSelectWindow(icon->owner);        }    }    if (XGrabPointer(dpy, icon->core->window, False, ButtonMotionMask		     |ButtonReleaseMask|ButtonPressMask, GrabModeAsync,		     GrabModeAsync, None, None, CurrentTime) !=GrabSuccess) {#ifdef DEBUG0	wwarning("pointer grab failed for icon move");#endif    }    while(1) {	WMMaskEvent(dpy, PointerMotionMask|ButtonReleaseMask|ButtonPressMask		   |ButtonMotionMask|ExposureMask, &ev);	switch (ev.type) {	 case Expose:	    WMHandleEvent(&ev);	    break;	 case MotionNotify:	    if (!grabbed) {		if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD		    || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {		    XChangeActivePointerGrab(dpy, ButtonMotionMask					    |ButtonReleaseMask|ButtonPressMask, 					     wCursor[WCUR_MOVE], CurrentTime);		    grabbed=1;		} else {		    break;		}	    }	    x = ev.xmotion.x_root - dx;	    y = ev.xmotion.y_root - dy;	    XMoveWindow(dpy, icon->core->window, x, y);	    break;	 case ButtonPress:	    break;	 case ButtonRelease:	    if (ev.xbutton.button != clickButton)		break;	    if (wwin->icon_x!=x || wwin->icon_y!=y)	      wwin->flags.icon_moved = 1;	    XMoveWindow(dpy, icon->core->window, x, y);	    wwin->icon_x = x;	    wwin->icon_y = y;#ifdef DEBUG	    puts("End miniwindow move");#endif	    XUngrabPointer(dpy, CurrentTime);	    return;	    	}    }}