@@ -243,7 +243,7 @@ private void EyeImageUpdateHandler(Mat image)
243243 return ;
244244
245245
246- int channels = image . Channels ( ) ;
246+ var channels = image . Channels ( ) ;
247247 if ( channels == 1 )
248248 {
249249 var width = image . Width ;
@@ -301,9 +301,9 @@ void UpdateBitmap(Mat image)
301301 {
302302 using var frameBuffer = _bitmap . Lock ( ) ;
303303
304- IntPtr srcPtr = image . Data ;
305- IntPtr destPtr = frameBuffer . Address ;
306- int size = image . Rows * image . Cols * image . ElemSize ( ) ;
304+ var srcPtr = image . Data ;
305+ var destPtr = frameBuffer . Address ;
306+ var size = image . Rows * image . Cols * image . ElemSize ( ) ;
307307
308308 unsafe
309309 {
@@ -619,7 +619,7 @@ private async Task StartCameraWithMaximization(CameraControllerModel model, bool
619619 backend = "" ;
620620
621621
622- bool success = false ;
622+ var success = false ;
623623 switch ( model . Camera )
624624 {
625625 case Camera . Face :
@@ -638,7 +638,11 @@ private async Task StartCameraWithMaximization(CameraControllerModel model, bool
638638
639639 if ( success )
640640 {
641- if ( startMaximized )
641+ // Only select the entire frame if and only if
642+ // 1) This call originates from the UI, IE a user has requested it
643+ // 2) The current camera differs from the previous (IE, an existing connection was interrupted)
644+ var lastOpenedCameraName = _localSettings . ReadSetting < string > ( "LastOpened" + model . Name ) ;
645+ if ( startMaximized && lastOpenedCameraName != model . DisplayAddress )
642646 {
643647 model . SelectWholeFrame ( ) ;
644648 }
@@ -705,7 +709,7 @@ private async Task RequestVRCalibration()
705709
706710 public Color GetBaseHighColor ( )
707711 {
708- Color color = Colors . White ;
712+ var color = Colors . White ;
709713 switch ( Application . Current ! . ActualThemeVariant . ToString ( ) )
710714 {
711715 case "Light" :
0 commit comments