mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
constellation: focusing and closing webviews (#30842)
* constellation: focusing, closing, and native window visibility * rename “browser” to “webview”, “unfocus” to “blur” * remove native window visibility from constellation * rename more “browser” to “webview” * guard clauses * don’t automatically focus when no webviews are focused * comment spec steps for window.close() * use format interpolation Co-authored-by: Martin Robinson <mrobinson@igalia.com> * fix formatting * rename “Webview” to “WebView” in types and type parameters * remove unused method * fix libsimpleservo --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
6baaa82826
commit
eb95703325
16 changed files with 533 additions and 285 deletions
|
@ -633,8 +633,8 @@ where
|
|||
self.compositor.capture_webrender();
|
||||
},
|
||||
|
||||
EmbedderEvent::NewBrowser(url, top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::NewBrowser(url, top_level_browsing_context_id);
|
||||
EmbedderEvent::NewWebView(url, top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::NewWebView(url, top_level_browsing_context_id);
|
||||
if let Err(e) = self.constellation_chan.send(msg) {
|
||||
warn!(
|
||||
"Sending NewBrowser message to constellation failed ({:?}).",
|
||||
|
@ -643,18 +643,18 @@ where
|
|||
}
|
||||
},
|
||||
|
||||
EmbedderEvent::SelectBrowser(top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::SelectBrowser(top_level_browsing_context_id);
|
||||
EmbedderEvent::FocusWebView(top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::FocusWebView(top_level_browsing_context_id);
|
||||
if let Err(e) = self.constellation_chan.send(msg) {
|
||||
warn!(
|
||||
"Sending SelectBrowser message to constellation failed ({:?}).",
|
||||
"Sending FocusBrowser message to constellation failed ({:?}).",
|
||||
e
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
EmbedderEvent::CloseBrowser(top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::CloseBrowser(top_level_browsing_context_id);
|
||||
EmbedderEvent::CloseWebView(top_level_browsing_context_id) => {
|
||||
let msg = ConstellationMsg::CloseWebView(top_level_browsing_context_id);
|
||||
if let Err(e) = self.constellation_chan.send(msg) {
|
||||
warn!(
|
||||
"Sending CloseBrowser message to constellation failed ({:?}).",
|
||||
|
@ -683,14 +683,11 @@ where
|
|||
}
|
||||
},
|
||||
|
||||
EmbedderEvent::ChangeBrowserVisibility(top_level_browsing_context_id, visible) => {
|
||||
let msg = ConstellationMsg::ChangeBrowserVisibility(
|
||||
top_level_browsing_context_id,
|
||||
visible,
|
||||
);
|
||||
EmbedderEvent::WebViewVisibilityChanged(webview_id, visible) => {
|
||||
let msg = ConstellationMsg::WebViewVisibilityChanged(webview_id, visible);
|
||||
if let Err(e) = self.constellation_chan.send(msg) {
|
||||
warn!(
|
||||
"Sending ChangeBrowserVisibility to constellation failed ({:?}).",
|
||||
"Sending WebViewVisibilityChanged to constellation failed ({:?}).",
|
||||
e
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue