mirror of
https://github.com/tauri-apps/cef-rs.git
synced 2026-01-31 00:55:21 +01:00
feat: unify bundle utilities under cef build-util feature feat: reenable sandbox support in cefsimple feat: add MainMenu.xib on mac fix: bypass tryToTerminateApplication for Command+Q fix: enable much smaller linux release builds
19 lines
627 B
Rust
19 lines
627 B
Rust
use cef::*;
|
|
use std::iter;
|
|
use windows_sys::Win32::{Foundation::HWND, UI::WindowsAndMessaging::*};
|
|
|
|
fn window_from_browser(browser: Option<&mut Browser>) -> Option<HWND> {
|
|
let window = browser?.host()?.window_handle().0;
|
|
Some(window.cast())
|
|
}
|
|
|
|
pub fn platform_title_change(browser: Option<&mut Browser>, title: Option<&CefString>) {
|
|
let Some(window) = window_from_browser(browser) else {
|
|
return;
|
|
};
|
|
|
|
let title = title.map(CefString::to_string).unwrap_or_default();
|
|
let title: Vec<_> = title.encode_utf16().chain(iter::once(0)).collect();
|
|
unsafe { SetWindowTextW(window, title.as_ptr()) };
|
|
}
|