Need Tray Icon / or Minimize the app at start-up
What problem would this solve?
- Whenever I open the app (it takes a few seconds for me), I go back to handle with something else instead of waiting (I have terrible attention span, I know 😭🤭), and suddenly the app pops-up on the screen.
- Especially it makes me annoyed if I'm writing something. For example, I'm writing this text right now, then I click on the app to open it, and come back here to continue writing. The app pops-up and interrupts the writing process.
What would you like?
- It would be great if the app had a tray icon, and option like "minimize to tray icon at the start-up." etc.
- Or else, just "minimize the app at start-up." would be an easy feature to bring on! 🙂😘
What have you tried instead?
- I just wanted help from @PathGao :)
Relabelled this as a bug, because the part that's actually interrupting you is one — and it's separate from both of the things you asked for.
The few seconds aren't the problem; what happens at the end of them is. The window is created hidden on purpose, so you don't get a white flash while the webview boots, and it's shown once the frontend finishes mounting. That's your few seconds, and it's ordinary startup cost. But the call that shows it also forces activation, and by then you've been gone for three seconds. Nothing in that step asks whether you're still there.
That is not a normal thing for an app to do. All three platforms have focus-stealing prevention, and an app that simply shows its window gets the right behaviour for free: if you've moved on, macOS leaves it in the background, Windows flashes the taskbar button instead. Markpad calls the one API per platform whose entire purpose is to punch through that — SetForegroundWindow on Windows, activateIgnoringOtherApps: on macOS, present_with_time(GDK_CURRENT_TIME) on Linux.
On Windows — where you are, from #676 — it goes further. When Windows refuses the foreground change, which is the protection working correctly, the toolkit's fallback synthesizes an Alt keypress to fake recent user input, then retries. That synthetic keypress is delivered to whatever window is foreground: yours. A lone Alt press activates the menu bar in most Windows apps. So the interruption you're describing may not only be the window appearing.
What will change. Cold start will show the window without taking focus. The few seconds stay, since that is real work, but the window will appear quietly behind whatever you moved on to and you go to it when you are ready. Nothing to configure.
A tray icon is not the way there, and it is not something I'm picking up. Four reasons, roughly by weight:
- A tray icon means closing the last window no longer quits the app. Markpad's close path runs the dirty-tab walk and writes the session snapshot on exactly that assumption. Splitting it into "hide" and "really quit", with different save semantics on each, is where data loss gets introduced.
- On Windows 10 and 11 the notification area collapses new icons into the overflow chevron by default. "Start minimized to tray" would mean the app vanishes for anyone who hasn't dragged it out — the opposite of what you're asking for.
- On Linux the tray isn't standard; GNOME needs an extension to show it at all. Combined with (1), those users get a process that no longer quits and no icon to quit it from.
- On macOS a menu bar item duplicates what the Dock icon already does.
It also wouldn't fix this. It works around the forced activation by ensuring the window never appears on its own, and leaves the bug in place for everyone who doesn't use a tray.
One note on the report itself. You filed this on the feature template, which doesn't ask for OS and version. I only knew you were on Windows 10 because you mentioned it in #676, and it turned out to matter here. Only the bug template asks for it. That's a gap on our side, not yours, and the templates are being changed.
And a request. Please don't @ me when you spot something you'd like. I go through everything here and label it when I sit down to it; a mention doesn't move an item up the queue, it just breaks that pass into interruptions. This one would have been read the same way without it.