diff --git a/ports/servoshell/minibrowser.rs b/ports/servoshell/minibrowser.rs index cb6f263c299..d2646cf695b 100644 --- a/ports/servoshell/minibrowser.rs +++ b/ports/servoshell/minibrowser.rs @@ -171,58 +171,64 @@ impl Minibrowser { } = self; let widget_fbo = *widget_surface_fbo; let _duration = context.run(window, |ctx| { - TopBottomPanel::top("toolbar").show(ctx, |ui| { - ui.allocate_ui_with_layout( - ui.available_size(), - egui::Layout::left_to_right(egui::Align::Center), - |ui| { - if ui.button("back").clicked() { - event_queue.borrow_mut().push(MinibrowserEvent::Back); - } - if ui.button("forward").clicked() { - event_queue.borrow_mut().push(MinibrowserEvent::Forward); - } - ui.allocate_ui_with_layout( - ui.available_size(), - egui::Layout::right_to_left(egui::Align::Center), - |ui| { - if ui.button("go").clicked() { - event_queue.borrow_mut().push(MinibrowserEvent::Go); - location_dirty.set(false); - } + // TODO: While in fullscreen add some way to mitigate the increased phishing risk + // when not displaying the URL bar: https://github.com/servo/servo/issues/32443 + if !window.fullscreen().is_some() { + TopBottomPanel::top("toolbar").show(ctx, |ui| { + ui.allocate_ui_with_layout( + ui.available_size(), + egui::Layout::left_to_right(egui::Align::Center), + |ui| { + if ui.button("back").clicked() { + event_queue.borrow_mut().push(MinibrowserEvent::Back); + } + if ui.button("forward").clicked() { + event_queue.borrow_mut().push(MinibrowserEvent::Forward); + } + ui.allocate_ui_with_layout( + ui.available_size(), + egui::Layout::right_to_left(egui::Align::Center), + |ui| { + if ui.button("go").clicked() { + event_queue.borrow_mut().push(MinibrowserEvent::Go); + location_dirty.set(false); + } - match self.load_status { - LoadStatus::LoadStart => { - ui.add(Spinner::new().color(Color32::GRAY)); - }, - LoadStatus::HeadParsed => { - ui.add(Spinner::new().color(Color32::WHITE)); - }, - LoadStatus::LoadComplete => { /* No Spinner */ }, - } + match self.load_status { + LoadStatus::LoadStart => { + ui.add(Spinner::new().color(Color32::GRAY)); + }, + LoadStatus::HeadParsed => { + ui.add(Spinner::new().color(Color32::WHITE)); + }, + LoadStatus::LoadComplete => { /* No Spinner */ }, + } - let location_field = ui.add_sized( - ui.available_size(), - egui::TextEdit::singleline(&mut *location.borrow_mut()), - ); + let location_field = ui.add_sized( + ui.available_size(), + egui::TextEdit::singleline(&mut *location.borrow_mut()), + ); - if location_field.changed() { - location_dirty.set(true); - } - if ui.input(|i| i.clone().consume_key(Modifiers::COMMAND, Key::L)) { - location_field.request_focus(); - } - if location_field.lost_focus() && - ui.input(|i| i.clone().key_pressed(Key::Enter)) - { - event_queue.borrow_mut().push(MinibrowserEvent::Go); - location_dirty.set(false); - } - }, - ); - }, - ); - }); + if location_field.changed() { + location_dirty.set(true); + } + if ui.input(|i| { + i.clone().consume_key(Modifiers::COMMAND, Key::L) + }) { + location_field.request_focus(); + } + if location_field.lost_focus() && + ui.input(|i| i.clone().key_pressed(Key::Enter)) + { + event_queue.borrow_mut().push(MinibrowserEvent::Go); + location_dirty.set(false); + } + }, + ); + }, + ); + }); + }; // The toolbar height is where the Context’s available rect starts. // For reasons that are unclear, the TopBottomPanel’s ui cursor exceeds this by one egui