Skip to content

Commit fb40f3c

Browse files
committed
docs
1 parent 4ca0d50 commit fb40f3c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/handler.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ pub trait WindowHandler: 'static {
99
fn on_frame(&self) -> core::result::Result<(), HandlerError>;
1010
/// Informs the handler that the window has been resized.
1111
///
12-
/// If this returns an error, the resize operation will be reverted in order to keep the current
13-
/// size.
12+
/// # Errors
13+
///
14+
/// This operation can fail, in which case an [`HandlerError`] can be returned.
15+
/// This can happen if e.g. an underlying buffer could not be resized, or some kind of driver error.
16+
///
17+
/// In case this `resized` operation fails, `baseview` will assume that it did not meaningfully
18+
/// change anything, and that the window is still able to render and operate at the previous size.
19+
///
20+
/// It will also attempt to resize the underlying platform window and parent window back to the
21+
/// previous size, but this is only a best-effort attempt since those operations can also fail.
1422
fn resized(&self, new_size: WindowSize) -> core::result::Result<(), HandlerError>;
1523
fn on_event(&self, event: Event) -> EventStatus;
1624
}

0 commit comments

Comments
 (0)