Index: view3d_select.c =================================================================== --- view3d_select.c (revision 40134) +++ view3d_select.c (working copy) @@ -951,6 +951,21 @@ } } +static int deselectall(Scene *scene) /* deselect all and returns the number of deselections actually happened */ +{ + Base *base; + int retVal = 0; + + for(base= FIRSTBASE; base; base= base->next) { + if (base->flag & SELECT) { + ED_base_object_select(base, BA_DESELECT); + retVal++; + } + } + + return retVal; +} + static Base *mouse_select_menu(bContext *C, ViewContext *vc, unsigned int *buffer, int hits, const int mval[2], short extend) { short baseCount = 0; @@ -1339,6 +1354,11 @@ WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); } + else + { + if(deselectall(scene) > 0) + WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene); + } return retval; }