mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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:
commit
d92e781a87
2 changed files with 7 additions and 0 deletions
|
@ -167,6 +167,9 @@ pub struct Opts {
|
||||||
|
|
||||||
/// True to exit after the page load (`-x`).
|
/// True to exit after the page load (`-x`).
|
||||||
pub exit_after_load: bool,
|
pub exit_after_load: bool,
|
||||||
|
|
||||||
|
/// Do not use native titlebar
|
||||||
|
pub no_native_titlebar: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_usage(app: &str, opts: &Options) {
|
fn print_usage(app: &str, opts: &Options) {
|
||||||
|
@ -411,6 +414,7 @@ pub fn default_opts() -> Opts {
|
||||||
disable_share_style_cache: false,
|
disable_share_style_cache: false,
|
||||||
parallel_display_list_building: false,
|
parallel_display_list_building: false,
|
||||||
exit_after_load: 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.optflag("", "sniff-mime-types" , "Enable MIME sniffing");
|
||||||
opts.optmulti("", "pref",
|
opts.optmulti("", "pref",
|
||||||
"A preference to set to enable", "dom.mozbrowser.enabled");
|
"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) {
|
let opt_match = match opts.parse(args) {
|
||||||
Ok(m) => m,
|
Ok(m) => m,
|
||||||
|
@ -614,6 +619,7 @@ pub fn from_cmdline_args(args: &[String]) {
|
||||||
disable_share_style_cache: debug_options.disable_share_style_cache,
|
disable_share_style_cache: debug_options.disable_share_style_cache,
|
||||||
parallel_display_list_building: debug_options.parallel_display_list_building,
|
parallel_display_list_building: debug_options.parallel_display_list_building,
|
||||||
exit_after_load: opt_match.opt_present("x"),
|
exit_after_load: opt_match.opt_present("x"),
|
||||||
|
no_native_titlebar: opt_match.opt_present("b"),
|
||||||
};
|
};
|
||||||
|
|
||||||
set_defaults(opts);
|
set_defaults(opts);
|
||||||
|
|
|
@ -87,6 +87,7 @@ impl Window {
|
||||||
parent: glutin::WindowID) -> Rc<Window> {
|
parent: glutin::WindowID) -> Rc<Window> {
|
||||||
let mut glutin_window = glutin::WindowBuilder::new()
|
let mut glutin_window = glutin::WindowBuilder::new()
|
||||||
.with_title("Servo".to_string())
|
.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_dimensions(window_size.to_untyped().width, window_size.to_untyped().height)
|
||||||
.with_gl(Window::gl_version())
|
.with_gl(Window::gl_version())
|
||||||
.with_visibility(is_foreground)
|
.with_visibility(is_foreground)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue