Skip to content

Commit

Permalink
Merge pull request #1049 from Chilledheart/qt_fix_broken_autostart
Browse files Browse the repository at this point in the history
qt: fix broken autostart feature
  • Loading branch information
Chilledheart authored Jul 23, 2024
2 parents 09be053 + b6b02b6 commit 7c53eb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
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

0 comments on commit 7c53eb9

Please sign in to comment.