mirror of
https://github.com/servo/servo.git
synced 2025-10-01 00:59:15 +01:00
Auto merge of #10026 - pcwalton:no-browserhtml-flash, r=metajack
compositing: In borderless mode, don't show the window until the page has loaded. This avoids a flash of unstyled content, which looks especially bad in browser.html since unstyled content is white and browser.html has a transparent background. Closes #9996. r? @metajack cc @jdm since you had some concerns <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10026) <!-- Reviewable:end -->
This commit is contained in:
commit
84d3ba0759
7 changed files with 23 additions and 13 deletions
|
@ -374,7 +374,7 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
fn load_end(&self, back: bool, forward: bool) {
|
||||
fn load_end(&self, back: bool, forward: bool, _: bool) {
|
||||
// FIXME(pcwalton): The status code 200 is a lie.
|
||||
let browser = self.cef_browser.borrow();
|
||||
let browser = match *browser {
|
||||
|
|
|
@ -93,13 +93,20 @@ impl Window {
|
|||
parent: Option<glutin::WindowID>) -> Rc<Window> {
|
||||
let width = window_size.to_untyped().width;
|
||||
let height = window_size.to_untyped().height;
|
||||
|
||||
// If there's no chrome, start off with the window invisible. It will be set to visible in
|
||||
// `load_end()`. This avoids an ugly flash of unstyled content (especially important since
|
||||
// unstyled content is white and chrome often has a transparent background). See issue
|
||||
// #9996.
|
||||
let visible = is_foreground && !opts::get().no_native_titlebar;
|
||||
|
||||
let mut builder =
|
||||
glutin::WindowBuilder::new().with_title("Servo".to_string())
|
||||
.with_decorations(!opts::get().no_native_titlebar)
|
||||
.with_transparency(opts::get().no_native_titlebar)
|
||||
.with_dimensions(width, height)
|
||||
.with_gl(Window::gl_version())
|
||||
.with_visibility(is_foreground)
|
||||
.with_visibility(visible)
|
||||
.with_parent(parent)
|
||||
.with_multitouch();
|
||||
|
||||
|
@ -613,7 +620,10 @@ impl WindowMethods for Window {
|
|||
fn load_start(&self, _: bool, _: bool) {
|
||||
}
|
||||
|
||||
fn load_end(&self, _: bool, _: bool) {
|
||||
fn load_end(&self, _: bool, _: bool, root: bool) {
|
||||
if root && opts::get().no_native_titlebar {
|
||||
self.window.show()
|
||||
}
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
|
@ -869,7 +879,7 @@ impl WindowMethods for Window {
|
|||
|
||||
fn load_start(&self, _: bool, _: bool) {
|
||||
}
|
||||
fn load_end(&self, _: bool, _: bool) {
|
||||
fn load_end(&self, _: bool, _: bool, _: bool) {
|
||||
}
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
}
|
||||
|
|
|
@ -820,7 +820,7 @@ impl WindowMethods for Window {
|
|||
fn load_start(&self, _: bool, _: bool) {
|
||||
}
|
||||
|
||||
fn load_end(&self, _: bool, _: bool) {
|
||||
fn load_end(&self, _: bool, _: bool, _: bool) {
|
||||
}
|
||||
|
||||
fn load_error(&self, _: NetError, _: String) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue