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:
Kamal Umudlu 2019-03-08 00:18:22 -05:00
parent e27653ceae
commit a8995fbf1a
8 changed files with 81 additions and 3 deletions

View file

@ -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,