@@ -17,18 +17,23 @@ use iced::{
1717} ;
1818
1919#[ cfg( target_os = "macos" ) ]
20- use crate :: macos :: { focus_this_app , transform_process_to_ui_element } ;
21- # [ cfg ( target_os = " macos" ) ]
22- use crate :: { macos , utils :: get_installed_apps } ;
23- # [ cfg ( target_os = "macos" ) ]
24- use objc2 :: rc :: Retained ;
25- # [ cfg ( target_os = "macos" ) ]
26- use objc2_app_kit :: NSRunningApplication ;
20+ use {
21+ crate :: macos:: { focus_this_app , macos_window_config , transform_process_to_ui_element } ,
22+ objc2 :: rc :: Retained ,
23+ objc2_app_kit :: NSApplicationActivationOptions ,
24+ objc2_app_kit :: NSRunningApplication ,
25+ objc2_app_kit :: NSWorkspace ,
26+ } ;
2727
2828#[ cfg( target_os = "windows" ) ]
29- use windows:: Win32 :: Foundation :: HWND ;
30- #[ cfg( target_os = "windows" ) ]
31- use windows:: Win32 :: UI :: WindowsAndMessaging :: { GetForegroundWindow , SetForegroundWindow } ;
29+ use {
30+ crate :: windows:: open_on_focused_monitor,
31+ crate :: windows:: open_on_focused_monitor,
32+ iced:: window:: Position :: Specific ,
33+ iced:: window:: Position :: Specific ,
34+ windows:: Win32 :: Foundation :: HWND ,
35+ windows:: Win32 :: UI :: WindowsAndMessaging :: { GetForegroundWindow , SetForegroundWindow } ,
36+ } ;
3237
3338use rayon:: iter:: { IntoParallelRefIterator , ParallelIterator } ;
3439use rayon:: slice:: ParallelSliceMut ;
@@ -170,8 +175,6 @@ impl Tile {
170175 #[ cfg( target_os = "windows" ) ]
171176 {
172177 // get normal settings and modify position
173- use crate :: windows:: open_on_focused_monitor;
174- use iced:: window:: Position :: Specific ;
175178 let pos = open_on_focused_monitor ( ) ;
176179 settings. position = Specific ( pos) ;
177180 }
@@ -182,7 +185,7 @@ impl Tile {
182185 {
183186 #[ cfg( target_os = "macos" ) ]
184187 {
185- macos :: macos_window_config (
188+ macos_window_config (
186189 & handle. window_handle ( ) . expect ( "Unable to get window handle" ) ,
187190 ) ;
188191 // should work now that we have a window
@@ -313,8 +316,6 @@ impl Tile {
313316 #[ cfg( target_os = "windows" ) ]
314317 {
315318 // get normal settings and modify position
316- use crate :: windows:: open_on_focused_monitor;
317- use iced:: window:: Position :: Specific ;
318319 let pos = open_on_focused_monitor ( ) ;
319320 let mut settings = default_settings ( ) ;
320321 settings. position = Specific ( pos) ;
@@ -482,8 +483,6 @@ impl Tile {
482483 pub fn capture_frontmost ( & mut self ) {
483484 #[ cfg( target_os = "macos" ) ]
484485 {
485- use objc2_app_kit:: NSWorkspace ;
486-
487486 let ws = NSWorkspace :: sharedWorkspace ( ) ;
488487 self . frontmost = ws. frontmostApplication ( ) ;
489488 } ;
@@ -498,8 +497,6 @@ impl Tile {
498497 pub fn restore_frontmost ( & mut self ) {
499498 #[ cfg( target_os = "macos" ) ]
500499 {
501- use objc2_app_kit:: NSApplicationActivationOptions ;
502-
503500 if let Some ( app) = self . frontmost . take ( ) {
504501 app. activateWithOptions ( NSApplicationActivationOptions :: ActivateIgnoringOtherApps ) ;
505502 }
0 commit comments