Auto merge of #7778 - paulrouget:decorationLessOption, r=jdm

Add a command line option to disable native titlebar



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7778)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-29 13:45:57 -06:00
commit d92e781a87
2 changed files with 7 additions and 0 deletions

View file

@ -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);

View file

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