pub struct Offscreen {
pub shared_texture_enabled: bool,
pub external_begin_frame_enabled: bool,
pub cursor_handler: Option<Arc<CursorHandler>>,
/* private fields */
}Expand description
Windowless browser configuration. The application owns painting, input/IME forwarding and composition; Tauri keeps its IPC, protocols and browser lifecycle. Offscreen webviews use Alloy style and cannot be reparented.
Enable settings.windowless_rendering_enabled through crate::Cef::with_settings
before creating an offscreen webview. Use crate::Cef::on_window_event for
native input and redraws, and crate::Webview::browser to reach CEF’s host API.
The native window and event types are tauri-winit’s: depend on the same
tauri-winit version this crate uses to name them.
Fields§
Delivers shared resources through RenderHandler::on_accelerated_paint.
Open and copy them during the callback, respecting CEF’s resource lifetime.
external_begin_frame_enabled: boolRequires the application to call BrowserHost::send_external_begin_frame.
cursor_handler: Option<Arc<CursorHandler>>Handles cursor changes; other display notifications remain managed by Tauri.
Implementations§
Source§impl Offscreen
impl Offscreen
Sourcepub fn new<F: Fn(OffscreenView) -> RenderHandler + Send + Sync + 'static>(
handler: F,
) -> Self
pub fn new<F: Fn(OffscreenView) -> RenderHandler + Send + Sync + 'static>( handler: F, ) -> Self
Creates a render handler for each webview on the CEF UI thread.
The handler must implement view_rect and a paint callback. Read the current
bounds and scale from view; call OffscreenView::request_redraw after painting.
CEF view rectangles use logical pixels, while paint buffers use physical pixels.
CEF callbacks must not block on queued Tauri window operations.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Offscreen
impl !UnwindSafe for Offscreen
impl Freeze for Offscreen
impl Send for Offscreen
impl Sync for Offscreen
impl Unpin for Offscreen
impl UnsafeUnpin for Offscreen
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.