mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add support for fullscreen #10102
This commit is contained in:
parent
c3c086e521
commit
55f0e56224
33 changed files with 454 additions and 30 deletions
|
@ -633,6 +633,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
func();
|
||||
}
|
||||
|
||||
(Msg::SetFullscreenState(state), ShutdownState::NotShuttingDown) => {
|
||||
self.window.set_fullscreen_state(state);
|
||||
}
|
||||
|
||||
// When we are shutting_down, we need to avoid performing operations
|
||||
// such as Paint that may crash because we have begun tearing down
|
||||
// the rest of our resources.
|
||||
|
|
|
@ -128,7 +128,9 @@ pub enum Msg {
|
|||
/// Runs a closure in the compositor thread.
|
||||
/// It's used to dispatch functions from webrender to the main thread's event loop.
|
||||
/// Required to allow WGL GLContext sharing in Windows.
|
||||
Dispatch(Box<Fn() + Send>)
|
||||
Dispatch(Box<Fn() + Send>),
|
||||
/// Enter or exit fullscreen
|
||||
SetFullscreenState(bool),
|
||||
}
|
||||
|
||||
impl Debug for Msg {
|
||||
|
@ -161,6 +163,7 @@ impl Debug for Msg {
|
|||
Msg::PipelineExited(..) => write!(f, "PipelineExited"),
|
||||
Msg::NewScrollFrameReady(..) => write!(f, "NewScrollFrameReady"),
|
||||
Msg::Dispatch(..) => write!(f, "Dispatch"),
|
||||
Msg::SetFullscreenState(..) => write!(f, "SetFullscreenState"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,6 +119,8 @@ pub trait WindowMethods {
|
|||
fn set_inner_size(&self, size: Size2D<u32>);
|
||||
/// Set the window position
|
||||
fn set_position(&self, point: Point2D<i32>);
|
||||
/// Set fullscreen state
|
||||
fn set_fullscreen_state(&self, state: bool);
|
||||
|
||||
/// Sets the page title for the current page.
|
||||
fn set_page_title(&self, title: Option<String>);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue