Emit bread.help.opened when the main window is shown
All checks were successful
dev release / build (push) Successful in 2m4s
All checks were successful
dev release / build (push) Successful in 2m4s
Fail-silent via bread-utils BreadClient (ecosystem v0.7.1, bread-client). No command verbs. Silent autostart and screenshot mode do not emit.
This commit is contained in:
parent
3634edef0d
commit
c9445fadcc
6 changed files with 90 additions and 6 deletions
|
|
@ -63,7 +63,7 @@ pub fn present(app: &Application, action: Action) {
|
|||
// (i.e. breadhelp wasn't already running) — a background daemon
|
||||
// event shouldn't steal focus from whatever the user is doing.
|
||||
if just_built {
|
||||
handle.window.present();
|
||||
show_window(&handle.window, action.autostart);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -77,11 +77,19 @@ pub fn present(app: &Application, action: Action) {
|
|||
}
|
||||
let silent_autostart = action.autostart && State::load().onboarding_completed();
|
||||
if !silent_autostart {
|
||||
handle.window.present();
|
||||
show_window(&handle.window, action.autostart);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Present the help window and publish `bread.help.opened`. Screenshot
|
||||
/// mode calls `window.present()` itself and must not go through here —
|
||||
/// that is capture, not a user-visible open.
|
||||
fn show_window(window: &ApplicationWindow, autostart: bool) {
|
||||
window.present();
|
||||
crate::services::breadd::emit_opened(autostart);
|
||||
}
|
||||
|
||||
fn build(app: &Application) -> Handle {
|
||||
// First thing on every cold start: revert any keybind a previous,
|
||||
// crashed run may have left temporarily rebound mid tour-step (see
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue