Skip to content

Commit

Permalink
Merge pull request #12 from Stremio/fix-focus-on-launch
Browse files Browse the repository at this point in the history
fix: focus main window on launching second instance
  • Loading branch information
core1024 authored Jan 16, 2025
2 parents c58cbaf + 8ecdb12 commit bb5387b
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 bb5387b

Please sign in to comment.