Skip to content

Commit

Permalink
Handle JS fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
core1024 committed Dec 23, 2024
1 parent f0d5a1c commit a8c1350
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stremio_app/stremio_wevbiew/wevbiew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl PartialUi for WebView {
let (tx, rx) = flume::unbounded();
let tx_drag_drop = tx.clone();
let (tx_web, rx_web) = flume::unbounded();
let tx_fs = tx_web.clone();
data.channel = RefCell::new(Some((tx, rx_web)));

let parent = parent.expect("No parent window").into();
Expand Down Expand Up @@ -123,6 +124,12 @@ impl PartialUi for WebView {
}
Ok(())
}).expect("Cannot add D&D handler");
webview.add_contains_full_screen_element_changed(move |wv| {
if let Ok(visibility) = wv.get_contains_full_screen_element() {
tx_fs.send(ipc::RPCResponse::response_message(Some(json!(["win-set-visibility" , {"fullscreen": visibility}])))).ok();
}
Ok(())
}).expect("Cannot add full screen element changed");

WebView::resize_to_window_bounds(Some(&controller), Some(hwnd));
controller.put_is_visible(true).ok();
Expand Down

0 comments on commit a8c1350

Please sign in to comment.