@@ -170,18 +170,30 @@ pub struct Tile {
170170impl Tile {
171171 /// A base window
172172 pub fn new ( keybind_id : u32 , config : & Config ) -> ( Self , Task < Message > ) {
173- let ( id, open) = window:: open ( default_settings ( ) ) ;
173+ let mut settings = default_settings ( ) ;
174+ #[ cfg( target_os = "windows" ) ]
175+ {
176+ // get normal settings and modify position
177+ use crate :: utils:: open_on_focused_monitor;
178+ use iced:: window:: Position :: Specific ;
179+ let pos = open_on_focused_monitor ( ) ;
180+ settings. position = Specific ( pos) ;
181+ }
174182
175- let open = open. discard ( ) . chain ( window:: run ( id, |handle| {
176- #[ cfg( target_os = "macos" ) ]
177- {
178- macos:: macos_window_config (
179- & handle. window_handle ( ) . expect ( "Unable to get window handle" ) ,
180- ) ;
181- // should work now that we have a window
182- transform_process_to_ui_element ( ) ;
183- } ;
184- } ) ) ;
183+ let ( id, open) = window:: open ( settings) ;
184+
185+ #[ cfg( target_os = "macos" ) ]
186+ {
187+ let open = open. discard ( ) . chain ( window:: run ( id, |handle| {
188+ {
189+ macos:: macos_window_config (
190+ & handle. window_handle ( ) . expect ( "Unable to get window handle" ) ,
191+ ) ;
192+ // should work now that we have a window
193+ transform_process_to_ui_element ( ) ;
194+ }
195+ } ) ) ;
196+ }
185197
186198 let store_icons = config. theme . show_icons ;
187199 let paths;
0 commit comments