mirror of
https://github.com/servo/servo.git
synced 2025-10-02 01:29:15 +01:00
Use Result instead of panicking when the resource dir can't be found
This commit is contained in:
parent
20b1764d71
commit
ceb85795b1
11 changed files with 81 additions and 64 deletions
|
@ -136,8 +136,6 @@ impl Window {
|
|||
// #9996.
|
||||
let visible = is_foreground && !opts::get().no_native_titlebar;
|
||||
|
||||
let mut icon_path = resource_files::resources_dir_path();
|
||||
icon_path.push("servo.png");
|
||||
|
||||
let mut builder =
|
||||
glutin::WindowBuilder::new().with_title("Servo".to_string())
|
||||
|
@ -147,8 +145,13 @@ impl Window {
|
|||
.with_gl(Window::gl_version())
|
||||
.with_visibility(visible)
|
||||
.with_parent(parent)
|
||||
.with_multitouch()
|
||||
.with_icon(icon_path);
|
||||
.with_multitouch();
|
||||
|
||||
|
||||
if let Ok(mut icon_path) = resource_files::resources_dir_path() {
|
||||
icon_path.push("servo.png");
|
||||
builder = builder.with_icon(icon_path);
|
||||
}
|
||||
|
||||
if opts::get().enable_vsync {
|
||||
builder = builder.with_vsync();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue