if (aHasShift && myMultiSelectionEnabled)
myAISContext->ShiftSelect( Standard_True );
- else
- myAISContext->Select( Standard_True );
+ else {
+ AIS_StatusOfPick sop = myAISContext->Select( Standard_True );
+ if (sop == AIS_SOP_NothingSelected) {
+ // Check whether the ViewCube had been picked to change view orientation
+ // => in this case, we don't want any existing selection in the active widget
+ // been cleared
+ Handle(SelectMgr_EntityOwner) anOwner = myAISContext->DetectedOwner();
+ if (!anOwner.IsNull() && anOwner->HasSelectable()) {
+ Handle(SelectMgr_SelectableObject) aSelObj = anOwner->Selectable();
+ if (!aSelObj.IsNull() && aSelObj->IsKind(STANDARD_TYPE(AIS_ViewCube)))
+ return;
+ }
+ }
+ }
emit selectionChanged();
}