mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-03-11 17:15:49 +00:00
fix: focus main window on launching second instance
This commit is contained in:
parent
aec176a238
commit
8ecdb1264b
1 changed files with 2 additions and 0 deletions
|
|
@ -174,11 +174,13 @@ impl MainWindow {
|
||||||
}); // thread
|
}); // thread
|
||||||
|
|
||||||
if let Ok(mut listener) = PipeServer::bind(socket_path) {
|
if let Ok(mut listener) = PipeServer::bind(socket_path) {
|
||||||
|
let focus_sender = self.focus_notice.sender();
|
||||||
thread::spawn(move || loop {
|
thread::spawn(move || loop {
|
||||||
if let Ok(mut stream) = listener.accept() {
|
if let Ok(mut stream) = listener.accept() {
|
||||||
let mut buf = vec![];
|
let mut buf = vec![];
|
||||||
stream.read_to_end(&mut buf).ok();
|
stream.read_to_end(&mut buf).ok();
|
||||||
if let Ok(s) = str::from_utf8(&buf) {
|
if let Ok(s) = str::from_utf8(&buf) {
|
||||||
|
focus_sender.notice();
|
||||||
// ['open-media', url]
|
// ['open-media', url]
|
||||||
web_tx_arg.send(RPCResponse::open_media(s.to_string())).ok();
|
web_tx_arg.send(RPCResponse::open_media(s.to_string())).ok();
|
||||||
println!("{}", s);
|
println!("{}", s);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue