Skip to content

Commit

Permalink
fix: focus main window on launching second instance
Browse files Browse the repository at this point in the history
  • Loading branch information
core1024 committed Jan 13, 2025
1 parent aec176a commit 8ecdb12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stremio_app/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,13 @@ impl MainWindow {
}); // thread

if let Ok(mut listener) = PipeServer::bind(socket_path) {
let focus_sender = self.focus_notice.sender();
thread::spawn(move || loop {
if let Ok(mut stream) = listener.accept() {
let mut buf = vec![];
stream.read_to_end(&mut buf).ok();
if let Ok(s) = str::from_utf8(&buf) {
focus_sender.notice();
// ['open-media', url]
web_tx_arg.send(RPCResponse::open_media(s.to_string())).ok();
println!("{}", s);
Expand Down

0 comments on commit 8ecdb12

Please sign in to comment.