mirror of
https://github.com/servo/servo.git
synced 2025-06-12 10:24:43 +00:00
Bug: #22853 - Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False
Added patch for bug:22853 Added implementation to exit from fullscreen mode by pressing ESC button Added patch that supports to exit from fullscreen mode by pressing ESC Deleted patch files Added all requested changes on project Removed the loop over self.pending_changes in switch_fullscreen_mode function Bug #22853 - Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False Added missing bracket in constellation.rs file to fix build issue Bug: #22853 --> Make Window::set_fullscreen pass a non-None value when entering fullscreen is fixed and SetFullscreenState in exit_fullscreen changed to False
This commit is contained in:
parent
e27653ceae
commit
a8995fbf1a
8 changed files with 81 additions and 3 deletions
|
@ -1304,6 +1304,10 @@ impl ScriptThread {
|
|||
// An event came-in from a document that is not fully-active, it has been stored by the task-queue.
|
||||
// Continue without adding it to "sequential".
|
||||
},
|
||||
FromConstellation(ConstellationControlMsg::ExitFullScreen(id)) => self
|
||||
.profile_event(ScriptThreadEventCategory::ExitFullscreen, Some(id), || {
|
||||
self.handle_exit_fullscreen(id);
|
||||
}),
|
||||
_ => {
|
||||
sequential.push(event);
|
||||
},
|
||||
|
@ -1500,6 +1504,7 @@ impl ScriptThread {
|
|||
Reload(id, ..) => Some(id),
|
||||
WebVREvents(id, ..) => Some(id),
|
||||
PaintMetric(..) => None,
|
||||
ExitFullScreen(id, ..) => Some(id),
|
||||
}
|
||||
},
|
||||
MixedMessage::FromDevtools(_) => None,
|
||||
|
@ -1731,6 +1736,7 @@ impl ScriptThread {
|
|||
msg @ ConstellationControlMsg::Viewport(..) |
|
||||
msg @ ConstellationControlMsg::SetScrollState(..) |
|
||||
msg @ ConstellationControlMsg::Resize(..) |
|
||||
msg @ ConstellationControlMsg::ExitFullScreen(..) |
|
||||
msg @ ConstellationControlMsg::ExitScriptThread => {
|
||||
panic!("should have handled {:?} already", msg)
|
||||
},
|
||||
|
@ -1953,6 +1959,19 @@ impl ScriptThread {
|
|||
warn!("resize sent to nonexistent pipeline");
|
||||
}
|
||||
|
||||
// exit_fullscreen creates a new JS promise object, so we need to have entered a compartment
|
||||
fn handle_exit_fullscreen(&self, id: PipelineId) {
|
||||
let document = self.documents.borrow().find_document(id);
|
||||
if let Some(document) = document {
|
||||
let _ac = JSAutoCompartment::new(
|
||||
document.global().get_cx(),
|
||||
document.reflector().get_jsobject().get(),
|
||||
);
|
||||
document.exit_fullscreen();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_viewport(&self, id: PipelineId, rect: Rect<f32>) {
|
||||
let document = self.documents.borrow().find_document(id);
|
||||
if let Some(document) = document {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue