-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
Hide Notes action in tray icon not working on GNOME #466
Comments
Probably to work around a bug in either some older Qt version, or some broken Linux desktop environment. Also, in my opinion, it seems a little odd that we're checking for so many things there: Lines 700 to 704 in 06e8f84
I suppose it's fine to check for those when the user presses the global hotkey to summon/hide Notes, but not otherwise? 🤔 Anyway, here's my attempt at fixing this (build artifacts for linux, mac, win, if needed). But before sending a pull request, I'd like to know if you guys agree with the above premise, of course. |
Did you check that indeed while minimized, |
But wouldn't that be misleading? For example, if I minimize Notes, its tray icon would still state "Hide Notes", so why clicking on it should restore Notes? 🤔 Unless we begin to listen to minimize/unminimize events to update our tray icon label accordingly? |
That would be my suggested fix for that, yeah. |
I get your argument, but I do think that if Notes is minimized and they click on the tray icon they would expect Notes to show up. |
Right right, I don't disagree with that. We'll just have to update our tray icon label too. Clicking on "Hide Notes" just to have its window restored is a bit weird :p Okay, I'll try to implement that! |
It will be trickier than I thought to implement this. Both Windows and Linux fire The But because right clicking the menu always deactivates the window, it's impossible for it to ever say "Hide Notes". I thought of a workaround that would involve adding a I'm very new at GUI programming though, so I don't know if I'm looking at this problem from the right angle. |
@guihkx Is there an |
That's perfect, thanks! I did some tests on Plasma 5.27 and Windows 11, and the behavior on both is perfectly consistent (according to myself anyway). However, there's this annoying bug, specific to GNOME 43, where after restoring Notes from the system tray and then focusing on some other window will, sometimes, not fire gnome-43-persistent-active-state-bug.mp4Which means But after searching a bit, I found this interesting piece of code, which seems to be used to detect if our window is obscured by other windows: And it works perfectly on GNOME! Except for that annoying "Notes is ready" notification that I get now, but that will also be gone once the focus-stealing 'feature' is implemented. 😄 Anyway, I should probably do some more testing before sending a pull request. |
I haven't tested on any other platform yet, but the Hide Notes action in the tray icon fails to hide Notes on GNOME 43. In debugging, I noticed it actually tries to make Notes visible, because
qApp->applicationState() == Qt::ApplicationInactive
istrue
. It looks like once the tray icon is clicked, the application already goes into inactive state.I wonder why this check is there in the first place? Ideally we can just remove it. It was added in 7478f5c so maybe @theshadowx remembers?
Note that the same check is done for the global shortcut.
The text was updated successfully, but these errors were encountered: