@@ -379,8 +379,6 @@ fn is_position_on_any_screen(pos_x: f64, pos_y: f64) -> bool {
379379
380380#[ derive( Clone , Deserialize , Type ) ]
381381pub enum CapWindowId {
382- // Contains onboarding + permissions
383- Setup ,
384382 Main ,
385383 Settings ,
386384 Editor { id : u32 } ,
@@ -402,7 +400,6 @@ impl FromStr for CapWindowId {
402400
403401 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
404402 Ok ( match s {
405- "setup" => Self :: Setup ,
406403 "main" => Self :: Main ,
407404 "settings" => Self :: Settings ,
408405 "camera" => Self :: Camera ,
@@ -446,7 +443,6 @@ impl FromStr for CapWindowId {
446443impl std:: fmt:: Display for CapWindowId {
447444 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
448445 match self {
449- Self :: Setup => write ! ( f, "setup" ) ,
450446 Self :: Main => write ! ( f, "main" ) ,
451447 Self :: Settings => write ! ( f, "settings" ) ,
452448 Self :: Camera => write ! ( f, "camera" ) ,
@@ -476,7 +472,6 @@ impl CapWindowId {
476472
477473 pub fn title ( & self ) -> String {
478474 match self {
479- Self :: Setup => "Cap Setup" . to_string ( ) ,
480475 Self :: Settings => "Cap Settings" . to_string ( ) ,
481476 Self :: WindowCaptureOccluder { .. } => "Cap Window Capture Occluder" . to_string ( ) ,
482477 Self :: CaptureArea => "Cap Capture Area" . to_string ( ) ,
@@ -495,8 +490,7 @@ impl CapWindowId {
495490 pub fn activates_dock ( & self ) -> bool {
496491 matches ! (
497492 self ,
498- Self :: Setup
499- | Self :: Main
493+ Self :: Main
500494 | Self :: Editor { .. }
501495 | Self :: ScreenshotEditor { .. }
502496 | Self :: Settings
@@ -543,7 +537,6 @@ impl CapWindowId {
543537
544538 pub fn min_size ( & self ) -> Option < ( f64 , f64 ) > {
545539 Some ( match self {
546- Self :: Setup => ( 600.0 , 600.0 ) ,
547540 Self :: Main => ( 330.0 , 395.0 ) ,
548541 Self :: Editor { .. } => ( 1275.0 , 800.0 ) ,
549542 Self :: ScreenshotEditor { .. } => ( 800.0 , 600.0 ) ,
@@ -559,7 +552,6 @@ impl CapWindowId {
559552
560553#[ derive( Debug , Clone , Type , Deserialize ) ]
561554pub enum ShowCapWindow {
562- Setup ,
563555 Main {
564556 init_target_mode : Option < RecordingTargetMode > ,
565557 } ,
@@ -930,6 +922,12 @@ impl ShowCapWindow {
930922 if !matches ! ( self , Self :: Camera { .. } | Self :: InProgressRecording { .. } )
931923 && let Some ( window) = self . id ( app) . get ( app)
932924 {
925+ if matches ! ( self , Self :: Main { .. } )
926+ && !permissions:: do_permissions_check ( false ) . necessary_granted ( )
927+ {
928+ return Box :: pin ( Self :: Onboarding . show ( app) ) . await ;
929+ }
930+
933931 let cursor_display_id = if let Self :: Main { init_target_mode } = self {
934932 if init_target_mode. is_some ( ) {
935933 Display :: get_containing_cursor ( )
@@ -973,37 +971,6 @@ impl ShowCapWindow {
973971 let cursor_monitor = CursorMonitorInfo :: get ( ) ;
974972
975973 let window = match self {
976- Self :: Setup => {
977- let window = self
978- . window_builder ( app, "/setup" )
979- . inner_size ( 600.0 , 600.0 )
980- . min_inner_size ( 600.0 , 600.0 )
981- . resizable ( false )
982- . maximized ( false )
983- . focused ( true )
984- . maximizable ( false )
985- . shadow ( true )
986- . build ( ) ?;
987-
988- let ( pos_x, pos_y) = cursor_monitor. center_position ( 600.0 , 600.0 ) ;
989- let _ = window. set_position ( tauri:: LogicalPosition :: new ( pos_x, pos_y) ) ;
990-
991- #[ cfg( windows) ]
992- {
993- use tauri:: LogicalSize ;
994- if let Err ( e) = window. set_size ( LogicalSize :: new ( 600.0 , 600.0 ) ) {
995- warn ! ( "Failed to set Setup window size on Windows: {}" , e) ;
996- }
997- if let Err ( e) = window. set_position ( tauri:: LogicalPosition :: new ( pos_x, pos_y) ) {
998- warn ! ( "Failed to position Setup window on Windows: {}" , e) ;
999- }
1000- }
1001-
1002- window. show ( ) . ok ( ) ;
1003- window. set_focus ( ) . ok ( ) ;
1004-
1005- window
1006- }
1007974 Self :: Main { init_target_mode } => {
1008975 if !permissions:: do_permissions_check ( false ) . necessary_granted ( ) {
1009976 return Box :: pin ( Self :: Onboarding . show ( app) ) . await ;
@@ -2155,7 +2122,6 @@ impl ShowCapWindow {
21552122
21562123 pub fn id ( & self , app : & AppHandle ) -> CapWindowId {
21572124 match self {
2158- ShowCapWindow :: Setup => CapWindowId :: Setup ,
21592125 ShowCapWindow :: Main { .. } => CapWindowId :: Main ,
21602126 ShowCapWindow :: Settings { .. } => CapWindowId :: Settings ,
21612127 ShowCapWindow :: Editor { project_path } => {
0 commit comments