mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01: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
|
@ -1230,6 +1230,9 @@ where
|
|||
}
|
||||
}
|
||||
},
|
||||
FromCompositorMsg::ExitFullScreen(top_level_browsing_context_id) => {
|
||||
self.handle_exit_fullscreen_msg(top_level_browsing_context_id);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3664,6 +3667,15 @@ where
|
|||
self.window_size = new_size;
|
||||
}
|
||||
|
||||
/// Called when the window exits from fullscreen mode
|
||||
fn handle_exit_fullscreen_msg(
|
||||
&mut self,
|
||||
top_level_browsing_context_id: TopLevelBrowsingContextId,
|
||||
) {
|
||||
let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id);
|
||||
self.switch_fullscreen_mode(browsing_context_id);
|
||||
}
|
||||
|
||||
/// Handle updating actual viewport / zoom due to @viewport rules
|
||||
fn handle_viewport_constrained_msg(
|
||||
&mut self,
|
||||
|
@ -3900,6 +3912,25 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
// Handle switching from fullscreen mode
|
||||
fn switch_fullscreen_mode(&mut self, browsing_context_id: BrowsingContextId) {
|
||||
if let Some(browsing_context) = self.browsing_contexts.get(&browsing_context_id) {
|
||||
let pipeline_id = browsing_context.pipeline_id;
|
||||
let pipeline = match self.pipelines.get(&pipeline_id) {
|
||||
None => {
|
||||
return warn!(
|
||||
"Pipeline {:?} switched from fullscreen mode after closing.",
|
||||
pipeline_id
|
||||
)
|
||||
},
|
||||
Some(pipeline) => pipeline,
|
||||
};
|
||||
let _ = pipeline
|
||||
.event_loop
|
||||
.send(ConstellationControlMsg::ExitFullScreen(pipeline.id));
|
||||
}
|
||||
}
|
||||
|
||||
// Close a browsing context (and all children)
|
||||
fn close_browsing_context(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue