diff options
author | Paul Rouget <me@paulrouget.com> | 2015-09-29 08:49:01 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2015-09-29 08:50:39 +0200 |
commit | 5be60f2c79f93d5007d4d85216d52bb69ee8e676 (patch) | |
tree | 0ed8175df4d8fe2cd0a1d079ab366d501494c9d7 | |
parent | d39c8546b6bf03c69b1cde925c72722dfd61e588 (diff) | |
download | servo-5be60f2c79f93d5007d4d85216d52bb69ee8e676.tar.gz servo-5be60f2c79f93d5007d4d85216d52bb69ee8e676.zip |
Add a command line option to disable native titlebar
-rw-r--r-- | components/util/opts.rs | 6 | ||||
-rw-r--r-- | ports/glutin/window.rs | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/components/util/opts.rs b/components/util/opts.rs index 42dc8ec3ae6..01dfee39491 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -167,6 +167,9 @@ pub struct Opts { /// True to exit after the page load (`-x`). pub exit_after_load: bool, + + /// Do not use native titlebar + pub no_native_titlebar: bool, } fn print_usage(app: &str, opts: &Options) { @@ -411,6 +414,7 @@ pub fn default_opts() -> Opts { disable_share_style_cache: false, parallel_display_list_building: false, exit_after_load: false, + no_native_titlebar: false, } } @@ -451,6 +455,7 @@ pub fn from_cmdline_args(args: &[String]) { opts.optflag("", "sniff-mime-types" , "Enable MIME sniffing"); opts.optmulti("", "pref", "A preference to set to enable", "dom.mozbrowser.enabled"); + opts.optflag("b", "no-native-titlebar", "Do not use native titlebar"); let opt_match = match opts.parse(args) { Ok(m) => m, @@ -614,6 +619,7 @@ pub fn from_cmdline_args(args: &[String]) { disable_share_style_cache: debug_options.disable_share_style_cache, parallel_display_list_building: debug_options.parallel_display_list_building, exit_after_load: opt_match.opt_present("x"), + no_native_titlebar: opt_match.opt_present("b"), }; set_defaults(opts); diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 2718fc6be1a..31d335a99f6 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -87,6 +87,7 @@ impl Window { parent: glutin::WindowID) -> Rc<Window> { let mut glutin_window = glutin::WindowBuilder::new() .with_title("Servo".to_string()) + .with_decorations(!opts::get().no_native_titlebar) .with_dimensions(window_size.to_untyped().width, window_size.to_untyped().height) .with_gl(Window::gl_version()) .with_visibility(is_foreground) |