-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
prevent focus stealing of update notification #2292
Comments
Are you able to have a look at the build-extra repo that creates that facility and see if you can pick out the relevant parts of the repo, at least as a helper to others to get them started. If you report back what you find then other contributors can work with you ensure that the right problem is fixed. If you find that you get all the way to a fix, then a Pull Request would also be welcomed. |
I don't see a way to tell Edit: That won't work as Edit2: If that doesn't work I think we can only set the |
I saw that a custom program is talked about which supersedes the tcl/tk way. a simple call to MessageBoxW might not be enough. Windows GUI does have ways of solving this: https://stackoverflow.com/questions/16209121/how-do-i-prevent-showdialog-from-stealing-focus-from-other-applications |
Wait. The real issue here is why the update notification is not shown as a Toast, but as a dialog box. Has anybody looked into that issue? This is the call that should show the toast: https://github.com/git-for-windows/build-extra/blob/7d7daddea1701455fe589eb45ba6b02297369d72/git-extra/git-update-git-for-windows#L229-L233 And this seems to be what you're seeing: https://github.com/git-for-windows/build-extra/blob/7d7daddea1701455fe589eb45ba6b02297369d72/git-extra/git-update-git-for-windows#L264-L269 I say "seems" because it is not really clear to me what is happening. |
There isn't any TCL/TK involved anymore since March 1st. It was changed to a C implementation for accessibility reasons. It uses WinAPI to create a MessageBox. The solution from the StackOverflow link you posted would require a .NET/winforms based implementation with a custom dialog. |
since "Toast" is only available on Win10 (maybe earlier, certainly not Win7), maybe this problem will "go away" when people stop using Win7 and Win8/8.1. I'm saying to not use MessageBoxW but create a custom window/form and control its creation flags. that doesn't require C#, only plain old winapi in C. it is more work though. |
All of that Stackoverflow discussion is about System.Windows.Forms.Form.Show(). |
If course Windows 7 can do this too, it just isn't called a toast message.
See here:
https://docs.microsoft.com/en-us/windows/win32/shell/notification-area
…On Mon, Aug 19, 2019, 2:34 PM Matthias Aßhauer ***@***.***> wrote:
All of that Stackoverflow discussion is about
System.Windows.Forms.Form.Show().
I'm sure it's possible with WinAPI, but that Stackoverflow link has
nothing to do with it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2292?email_source=notifications&email_token=ABZH5SAOIOHYSOEKEJD76PLQFLRSNA5CNFSM4IMTYPTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4T4S5A#issuecomment-522701172>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZH5SBJ7E5ANHET6PSASODQFLRSNANCNFSM4IMTYPTA>
.
|
Yes, Windows 7 (and older versions, too) allows you to create tray notifications, too. they aren't quite toast messages, but close enough for many intents and purposes. The "WinToast" tool used by Git for Windows only works on Windows 8 and Windows 10. Also those tray notifications don't allow you yes/no buttons AFAIK, thus aren't what's wanted for the updater. With WinToast, this only works on Windows 10. |
so, is focus stealing on windows 7 a concern? I can see why it wouldn't be, seeing as Win7 will lose support from MS soon. if it is though, solutions could be:
|
Yes.
A better alternative would be for you to offer a Pull Request instead. This would be the option I prefer, by far. |
I'm just a user. I am entirely unfamiliar with the code base of wintoast or of git-for-windows. don't put your hopes in me. |
hi @crackwitz any help is always welcome, even if it is only a small step. Git is open source so we should be able to have lots of small incremental contributions from the millions of Windows downloads... Even just the step of being able to special case your Microsoft Windows [Version 6.1.7601] may get you enough along the road to allow an adequate resolution for the older installs (E.g. you idea of flashing the icon, ..] |
14 years ago, I was also just a user of Git. For me, also, there was something that did not quite work for me. I learned how to fix it, and how to contribute, and it was fixed. You can do the exact same thing, you just have to allow yourself to do it.
Don't be afraid to ask for help getting started.
Oh, I don't. You might want to put your hopes in yourself, though, as it is unlikely that anybody else will work on this. The fact is that this is Open Source. You have an enormous amount of power and control over your own fate. You can learn just enough C/C++ to fix this. And then fix it. It's quite a freedom you have there, not having to depend on, say, a company to fix this for you. |
Setup
defaults?
to the issue you're seeing?
None.
Details
Minimal, Complete, and Verifiable example
this will help us understand the issue.
None. It's the daily update check.
That it appears, but does NOT steal focus. The proper thing to do is to flash the task bar icon/button for attention, but otherwise not disrupt the user.
It stole the focus. If I had been typing at the moment and didn't notice, I would have eventually hit space bar and thus pressed some button in the dialog.
The text was updated successfully, but these errors were encountered: