mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-03-11 21:27:06 +00:00
Handle JS fullscreen
This commit is contained in:
parent
91f9d4a460
commit
9af504b92a
1 changed files with 7 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue