Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt: fix broken autostart feature #1049

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gtk/yass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace config {
const ProgramType pType = YASS_CLIENT_GUI;
} // namespace config

ABSL_FLAG(bool, background, false, "start up backgroundd");
ABSL_FLAG(bool, background, false, "start up background");

YASSApp* mApp = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/gtk4/yass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace config {
const ProgramType pType = YASS_CLIENT_GUI;
} // namespace config

ABSL_FLAG(bool, background, false, "start up backgroundd");
ABSL_FLAG(bool, background, false, "start up background");

YASSApp* mApp = nullptr;

Expand Down
6 changes: 6 additions & 0 deletions src/qt6/yass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace config {
const ProgramType pType = YASS_CLIENT_GUI;
} // namespace config

ABSL_FLAG(bool, background, false, "start up background");

#ifdef _WIN32
void YASSApp::commitData(QSessionManager& manager) {
if (auto main = App()->main_window_.get()) {
Expand Down Expand Up @@ -184,6 +186,10 @@ bool YASSApp::Init() {
main_window_->show();
main_window_->moveToCenter();

if (absl::GetFlag(FLAGS_background)) {
main_window_->hide();
}

tray_icon_ = new TrayIcon(this);
tray_icon_->show();

Expand Down
2 changes: 1 addition & 1 deletion src/win32/yass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace config {
const ProgramType pType = YASS_CLIENT_GUI;
} // namespace config

ABSL_FLAG(bool, background, false, "start up backgroundd");
ABSL_FLAG(bool, background, false, "start up background");

#define MULDIVDPI(x) MulDiv(x, uDpi, 96)

Expand Down
Loading