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

New installation doesn't show tray icon on macOS 13.2.1 (but is running in the background) #192

Open
xor-gate opened this issue Mar 26, 2023 · 24 comments
Labels
bug macos-12 macOS Monterey macos-13 macOS Ventura macos-14 macOS Sonoma macos-15 macOS Ventura should reproduce Should try to reproduce the problem

Comments

@xor-gate
Copy link
Member

This a followup of #188 (comment).

Recap:

  • User did download the DMG release
  • Installed it on macOS 13.2.1
  • Nothing is shown in the status bar, the tray icon is not visible
  • The ~/Library/Application Support/Syncthing/syncthing.log syncthing daemon logfile is created
  • When the Syncthing.app is clicked again, it says it is already running

As I don't own hardware to run Syncthing on macOS 13.2.1 I'm unable to reproduce this. My hardware only supports macOS 12 or 11 unfortunatly.

@xor-gate
Copy link
Member Author

@joelowjw there was also some testing done by people on macOS 13.2.1 on the forum. It seems to work on 13.2.1 without problems. See also forum.syncthing.net/t/syncthing-macos-is-broken-on-macos-13-2-1.

@abraham-chan
Copy link

abraham-chan commented Mar 31, 2023

Just to note, I'm also on 13.2.1 (M1 Pro), did a fresh install via github releases dmg and no icon in taskbar appeared. I can confirm via Finder that the log file exists.
I killed the 2 processes via Activity Monitor and tried to launch the application again and this time it showed an auto-update confirmation modal but still doesn't show the icon in the taskbar.

Skimming through the log file doesn't appear to show any errors. Accesing http://127.0.0.1:8384/ shows a syncthing UI

@abraham-chan
Copy link

Oh.. nevermind. It turns out I just had too many icons in the taskbar and the syncthings one was hidden under the notch 😂
@joelowjw perhaps that's the issue for you too.

@xor-gate
Copy link
Member Author

Hi @abraham-chan. the notch, yeah that can be a problem... Thanks for reporting it back. Have a nice weekend and enjoy Syncthing for macOS ;-)

@AnCh7
Copy link

AnCh7 commented Apr 12, 2023

Still an issue for me. Nothing hides behind the notch. Ventura 13.3.1 (22E261)

@kwlorenz
Copy link

Did you install it as a DMG-download or via Homebrew? I am running a M2 MacBook Pro and installed via Homebrew ... autostart did not work. after installing as a direct download, everything worked. Perhaps this will solve your problem ?

@xor-gate
Copy link
Member Author

There must be something going on, which I can not reproduce because I don't own hardware for Ventura (and a notch). Its a different application but dropbox users seems to have the same issue (sometimes):
https://www.dropboxforum.com/t5/Apps-and-Installations/Dropbox-icon-missing-from-menu-bar-on-macOS-Ventura/td-p/643243/page/4

@redpola
Copy link

redpola commented Jul 28, 2023

Reproduced here on 13.4.1 (22F82)

First time install. Opened the app. Nothing seemed to happen. No evidence that it was running.

Found it was running using the terminal. Even then couldn't kill it from there. Eventually googled and found this issue and discovered the local admin web page which did allow me to close it down.

Notes:

This is NOT a notch issue.

Also, I ran it from the terminal to see what its output was and it ran but complained syncthing was already running, yet continued to keep retrying rather than die- another bug, surely?

@bpaccount1
Copy link

bpaccount1 commented Aug 22, 2023

Same problem for me on Syncthing-1.23.7-1.
M2 MacBook Air.

Never had Synching on this device before - I installed it and opening the Application does nothing.
No icon in the top bar either.

I can see it running in the process monitor.

@xor-gate
Copy link
Member Author

Same problem for me on Syncthing-1.23.7-1. M2 MacBook Air.

Never had Synching on this device before - I installed it and opening the Application does nothing. No icon in the top bar either.

I can see it running in the process monitor.

Please give macOS version

@bpaccount1
Copy link

Please give macOS version

I'm on 13.5.1

@hidezember
Copy link

Same bugs. My macos version is 12.7.
Accesing http://127.0.0.1:8384/ shows a syncthing UI, but no icon in the top bar.

@kagahd
Copy link

kagahd commented Jan 4, 2024

Same bugs. My macos version is 13.6.3.
Accessing http://127.0.0.1:8384/ shows a syncthing UI, but no icon in the top bar.

It seems that the Synthing icon was hidden by the notch or, maybe, at the right side of the notch is too few space to show further icons such as Synthing (a Docker icon was also missing there).
When attaching to an external monitor, the Syncthing icon is perfectly displayed in the top bar (the Docker icon too).

@xor-gate
Copy link
Member Author

xor-gate commented Jan 5, 2024

I'm finaly running one machine on macOS Sonoma 14.2 with OpenCore-compatibility patches (iMac without notch). Don't see any problems on Big Sur (macOS 11) on macbook 2013 (without notch). By reading the reports it seems not related to a major OS release. But maybe related to the display notch implementation bug?

@xor-gate xor-gate added macos-13 macOS Ventura macos-12 macOS Monterey labels Jan 5, 2024
@dxcore35
Copy link

Same problem here.

  • M1 max
  • Mac OS 14.3 (23D56)

No icon or indication that app is runing. But http://127.0.0.1:8384 is working.

@chrisbruford
Copy link

chrisbruford commented Jun 12, 2024

Same problem here

  • M2 Max
  • Mac OS 14.5

It is running and syncing fine but no tray icon

edit: While there was seemingly enough space in my taskbar for the icon - it seems icons stop displaying well before the notch, and so removing a number of other icons eventually showed the syncthing icon.

@xor-gate
Copy link
Member Author

@chrisbruford thanks for the update. The notch seems to be problematic...

@redpola
Copy link

redpola commented Jun 13, 2024

Just to clarify my earlier comment, my machine is a notch machine but the syncthing menu bar item was not hidden by the notch.

I don't believe this is a notch issue. No other apps I've installed have exhibited a similar problem.

@AlliotTech
Copy link

I think this issue has arisen again. The process is running, but there is no system tray icon.
v1.27.8, macOS (64-bit ARM)
macos 14.5

@xor-gate xor-gate added the macos-14 macOS Sonoma label Aug 1, 2024
@xor-gate
Copy link
Member Author

xor-gate commented Aug 1, 2024

This has been a issue with some users ranging from macOS 12 tot macOS 14. I'm on an old iMac which can only run macOS 12 and a macBook with even an older OS. Never had the chance to see/debug this myself unfortunatly.

@bwkrk
Copy link

bwkrk commented Sep 27, 2024

Hi, issue is applcable for me

i had fresh install

  • v1.27.12, macOS (64-bit ARM)
  • Version 15.0 (24A335) Sequoia
  • process is in place, but there is system tray icon or app in docker
image

however, i have another machine with

  • v1.27.12, macOS (64-bit Intel)
  • Version 15.0 (24A335) Sequoia (same as above)
    and there is a system tray icon in place

----> seems like issue is related to ARM processor?

@xor-gate xor-gate added the macos-15 macOS Ventura label Sep 27, 2024
@xor-gate
Copy link
Member Author

xor-gate commented Sep 27, 2024

i had fresh install

  • v1.27.12, macOS (64-bit ARM)
  • Version 15.0 (24A335) Sequoia
  • process is in place, but there is system tray icon or app in docker

however, i have another machine with

  • v1.27.12, macOS (64-bit Intel)
  • Version 15.0 (24A335) Sequoia (same as above)
    and there is a system tray icon in place

----> seems like issue is related to ARM processor?

Thanks for mentioning this, I have no ARM machine where I can try (only intel old machines). But this is very nice finding. Hopefully I can look into it, then it has probably something todo with the hybrid build for ARM/intel target in one binary. Maybe I'm missing some permissions or build flags for the ARM target. Fingers crossed 🤞

@xor-gate
Copy link
Member Author

xor-gate commented Sep 27, 2024

I mis understood

seems correct.

VALID_ARCHS = "x86_64 arm64";

Should output ARM executable part and not run under Rosetta 2 (intel -> arm) translation layer.

Latest release:

jerry@Jerrys-iMac ~ % file /Applications/Syncthing.app/Contents/MacOS/Syncthing
/Applications/Syncthing.app/Contents/MacOS/Syncthing: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
/Applications/Syncthing.app/Contents/MacOS/Syncthing (for architecture x86_64):Mach-O 64-bit executable x86_64
/Applications/Syncthing.app/Contents/MacOS/Syncthing (for architecture arm64):	Mach-O 64-bit executable arm64
objective c macos menu bar application not showing on ARM machines, how to fix?

ChatGPT said:

ChatGPT
If your macOS menu bar application is not showing:

4. App Sandbox or Permissions Issue:
Issue: On newer versions of macOS and especially on ARM, sandboxing or permission settings might prevent the app from showing in the menu bar.
Fix: Check if your app has appropriate App Sandbox entitlements if it is sandboxed.
Ensure the app has the required permissions to interact with the system status bar.

I need to look into that...

@xor-gate
Copy link
Member Author

xor-gate commented Sep 27, 2024

The story continues (note to self)

xcode project how to set arm sandbox settings system status bar

ChatGPT said:

ChatGPT
To configure your Xcode project for ARM machines and ensure the proper sandbox settings for a macOS menu bar application that interacts with the system status bar, follow these steps:

1. Enabling App Sandbox in Xcode
App Sandbox limits the app’s access to system resources, and you may need to configure specific entitlements to ensure your app can interact with the system status bar.

Open your Xcode project.
Select your target from the Project Navigator.
Go to the Signing & Capabilities tab.
Click the + Capability button in the upper-left corner.
In the list of capabilities, choose App Sandbox.
This will add the necessary entitlements to the app.
2. Setting App Sandbox Permissions
When App Sandbox is enabled, certain permissions can be granted for your app. For a menu bar application, you need to configure the appropriate entitlements:

Outgoing Network Connections: This allows your app to communicate over the network (if needed).

Check the Outgoing Connections (Client) option if your app requires network communication.
File Access: If your app needs to read or write to files outside of the sandbox, you can specify file access permissions here. However, this is usually not needed for a menu bar app unless you're saving/loading settings.

For a typical menu bar app, enabling the Outgoing Network Connections is common, but file access is generally not required unless you explicitly need it.

3. Ensure System Status Bar Access
Even with sandboxing enabled, you don't need special permissions to interact with the system status bar. Just make sure your app is properly configuring the NSStatusBar and NSStatusItem components in code.

Here’s an example of how to set up a status bar item in Objective-C:

objective
Copy code
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSStatusBar *statusBar = [NSStatusBar systemStatusBar];
    NSStatusItem *statusItem = [statusBar statusItemWithLength:NSSquareStatusItemLength];

    statusItem.button.image = [NSImage imageNamed:@"YourMenuIcon"];
    statusItem.button.action = @selector(statusBarItemClicked:);
    statusItem.button.target = self;
}
4. Set LSUIElement in the Info.plist
To make your application run as a background app (without a Dock icon and only in the system status bar), you need to modify the Info.plist file. This setting ensures that your app won't appear in the Dock or the application switcher:

Open the Info.plist file of your project.
Add the following key:
xml
Copy code
<key>LSUIElement</key>
<string>1</string>
This setting makes your app a "UIElement" which means it won't show in the Dock, but the status bar item will still appear.

5. Compiling for ARM (Apple Silicon)
Ensure your app is properly compiled for ARM64 architecture so it works on Apple Silicon machines:

In your Xcode project, go to Build Settings.
Under Architectures, set Architectures to Standard architectures (Apple Silicon, Intel) (i.e., $(ARCHS_STANDARD)).
Ensure that Build Active Architecture Only is set to No for both Debug and Release builds, so that it compiles for both Intel and ARM architectures.
6. Testing App on Apple Silicon
To test your app on Apple Silicon, you can:

Run your app on an M1/M2 Mac using Xcode.
Ensure it's compiled as a Universal Binary so it runs natively on both Intel and ARM Macs.
7. Debugging Permissions and Errors
If the status bar item does not appear or the app has other sandbox-related issues, check the Console.app for system logs. Look for any entitlement or permission errors.

By following these steps, your macOS menu bar app should have the correct sandbox permissions and will work on ARM (Apple Silicon) devices while properly interacting with the system status bar.

xor-gate added a commit that referenced this issue Sep 27, 2024
…ment (see #192)

Use string type instead of implicit bool for LSUIElement which is hooked to the macOS system status bar (see #192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug macos-12 macOS Monterey macos-13 macOS Ventura macos-14 macOS Sonoma macos-15 macOS Ventura should reproduce Should try to reproduce the problem
Projects
None yet
Development

No branches or pull requests