Skip to content

Commit

Permalink
fix: double icons in the dock bar on macOS (#65) (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticLampyrid authored Oct 9, 2024
1 parent 7418d3a commit 94f8c5b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Tray/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ void exitApp() {

int main(int argc, char* argv[]) {
#ifdef __APPLE__
// Prevent Qt being too clever
// See also https://github.com/qt/qtbase/blob/6.5.0/src/plugins/platforms/cocoa/qcocoaintegration.mm#L133-L139
qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1");

// Transform the process into a UI element application,
// which doesn't have a Dock icon or menu bar.
ProcessSerialNumber psn = {0, kCurrentProcess};
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
#endif
Expand Down

0 comments on commit 94f8c5b

Please sign in to comment.