-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Disable winhooks if screen reader is active #3896
Conversation
Executables are only detected when Mumble is started, but it's certainly better than not handling them at all. Aside from that, the code looks good! I would use CreateToolhelp32Snapshot() instead of EnumProcesses(): mumble/plugins/mumble_plugin_win32.h Lines 30 to 49 in 2004de9
|
Also, I used the Query* process functions because I wasn't sure how to do this with the snapshot API. Is there a way I can call the plugin frim the GlobalShortcut_win.cpp file? |
You can use the snapshot functions in |
Should I just |
No, that's the header we use for plugins, you should include |
I just pretty much copy-pasted (and then modified) the getProcess() function from the win32 plugin header file. Let's hope the checks pass this time. I'll fix them if they don't. :) |
// Disable hooking if a screen reader is running
bool bFoundSr = false;
const QStringList srList = { QLatin1String("nvda.exe"), QLatin1String("jfw.exe") };
const auto snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (snapshot != INVALID_HANDLE_VALUE) {
PROCESSENTRY32 processEntry;
processEntry.dwSize = sizeof(processEntry);
auto ok = Process32First(snapshot, &processEntry);
while (ok) {
if (stList.contains(QString::fromWCharArray(processEntry.szExeFile))) {
bFoundSr = true;
break;
}
ok = Process32Next(snapshot, &processEntry);
}
CloseHandle(snapshot);
}
// "winhooks" is a hidden setting to disable hooking
bHook = g.qs->value(QLatin1String("winhooks"), true).toBool() || bFoundSr; |
That works too... sorry -- I'm not exactly familiar with this API, so thanks for the help. I'll put that in my function though -- keep all of that code nice and clean. |
No problem, you're welcome. |
There we go, committed (and credited you of course). Now we wait for these checks to pass and we should be all good to go. |
Don't worry about the credits, it's fine. |
I assume you're editing the files on GitHub, right? Let me squash the commits for you. |
Sure thing. And I'm editing them on my computer, not on git hub, but I push every time I make an edit. Never squashed a commit before though. |
Oh, sorry, I assumed you were editing the files on GitHub because all commits are signed, but I just noticed it's your own GPG key. Would you like to squash the commits? |
Yes |
Assuming there are 5 commits:
|
Rebased. Was a bit confused so the rebase commit is a bit confusing, but undersand it now. :) |
Did you force-push after rebasing the commits? I still see all commits. About the merge commit: I always recommend to enable
|
had to pull and then push. The server disallowed me from pushing until I pulled. |
Just saw some checks fail. I'll fix those when I get back from dinner. |
Because when you rewrite history you have to force-push, either with
No problem, see #3896 (review). |
OK, just pushed new changes, let's see if checks pass this time. |
Submitted that fix about 5-6 minutes (or more, dunno) ago. Waiting for checks to pass now. |
Working on fixing that failure now. |
Yes - it worked ^^ Note however that while looking through the code I encountered that I think you are doing the opposite of what you wanted to achieve (I think). Please see my code-review for details :) |
Yes, that's what I want. :) Thanks for picking that up -- I would've
missed it! :)
…On 1/20/20, Robert Adam ***@***.***> wrote:
Krzmbrzl commented on this pull request.
> @@ -129,7 +132,8 @@ GlobalShortcutWin::GlobalShortcutWin()
#endif
{
// Hidden setting to disable hooking
- bHook = g.qs->value(QLatin1String("winhooks"), true).toBool();
+ // Also disable hooking if a screen reader is running
+ bHook = g.qs->value(QLatin1String("winhooks"), true).toBool() ||
areScreenReadersActive();
Also if you want to force-disable winhooks if a screenreader is active,
you'll have to use
```
bHook = g.qs->value(QLatin1String("winhooks"), true).toBool() &&
!areScreenReadersActive();
```
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#3896 (comment)
--
Signed,
Ethin D. Probst
|
Updated and fixed. Hopefully this works. |
… of winhooks if a screen reader was found to be running at app startup
I squashed the commits together again. Btw.: What does this change have to do with the overlay? I only see that this is related to shortcuts, but I don't see a relationship to the overlay-feature of mumble 🤔 |
The global shortcuts files, if I'm not mistaken, deal with the overlay as well, since the overlay uses windows hooks for it to work, no? |
Hm could be. Dunno though. That's something we'll have to ask @davidebeatrici In the meantime I'd ask you to force-pull (git pull - f) the current state from your branch to your local machine and test whether this now works as expected :) |
It should, not sure why tests are failing. |
CI is failing because it has trouble installing dependencies. That happens from time to time and is not related to the code changes. I'm not referring to whether the code compiles. I'm talking about testing if the code does what it is supposed to do. Compiling is only half the story. |
That will be kinda hard. I can't test it without a screen reader (as I myself anvisually impaired) and I can't build it on the windows side so will need to build with MinGW. But once I've done that I can test to see if winhooks are disabled when a screen reader is active. |
Ah okay - no problem I guess that testing whether the hooks are disabled if a screen reader is active is enough. And MinGW should be fine :) |
It'll take me a bit, but I'll get back to you today. |
Thank you very much for pushing this forward! I confirm that the changes only afflict global shortcuts. |
In that case, I'll adapt the commit message accordingly before this will be merged eventually :) |
@ethindp did you already get to test your changes? |
I am not able to right now. MXE takes far too long to build on Linux
for me (and when I got all the required packages to build it couldn't
find MXE's version of qmake, which apparently wasn't built). I have
the mingw-w64 versions of all of that on here but I don't know how to
get it to statically link everything. Sorry!
I've also come down with the flue recently, so I don't have much
energy to do this stuff at the moment.
…On 1/30/20, Robert Adam ***@***.***> wrote:
@ethindp did you already get to test your changes?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#3896 (comment)
--
Signed,
Ethin D. Probst
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I have had a bit more experience with the code base I'm confident that the changes made here should be fine.
Thank you for your contribution :) |
I was wondering when this would happen. I would be quite happy to
continue to assist in Mumbles development where I can. It would be
nice to see the pace of the project increase -- it seems as though its
in a sort-of stasis mode.
…On 5/26/20, Robert Adam ***@***.***> wrote:
Thank you for your contribution :)
(And sorry that it took so long to process this PR)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#3896 (comment)
--
Signed,
Ethin D. Probst
|
*was |
Glad to hear that! I've been trying to sync my fork with the latest
upstream (I had to add that as a remote, you know, which is weird). I
can't cloen it properly at the moment:
Submodule path '3rdparty/celt-0.7.0-src': checked out
'5a16cda6d78cda0cd14eb13c56c65d82724842e5'
Submodule path '3rdparty/mach-override-src': checked out
'919148f94db54fc04d287eb6a42c0c36b166bbfa'
Submodule path '3rdparty/minhook-src': checked out
'5e338f86bc29ff9de49a274ae6cbc0c21cdc1159'
Submodule path '3rdparty/opus-src': checked out
'ad8fe90db79b7d2a135e3dfd2ed6631b0c5662ab'
Submodule path '3rdparty/rnnoise-src': checked out
'b30f2bb8049601c3b7253d47f75dc6a68c5f32fd'
Submodule path '3rdparty/sbcelt-src': checked out
'045493d60b269ddb0096121552fd4d912704d4bf'
Submodule 'celt-0.7.0' (https://git.xiph.org/celt.git/) registered for
path '3rdparty/sbcelt-src/celt-0.7.0'
Cloning into 'C:/Users/ethin/source/mumble/3rdparty/sbcelt-src/celt-0.7.0'...
fatal: unable to access 'https://git.xiph.org/celt.git/': Failed to
connect to git.xiph.org port 443: Connection refused
fatal: clone of 'https://git.xiph.org/celt.git/' into submodule path
'C:/Users/ethin/source/mumble/3rdparty/sbcelt-src/celt-0.7.0' failed
Failed to clone 'celt-0.7.0'. Retry scheduled
Cloning into 'C:/Users/ethin/source/mumble/3rdparty/sbcelt-src/celt-0.7.0'...
fatal: unable to access 'https://git.xiph.org/celt.git/': Failed to
connect to git.xiph.org port 443: Connection refused
fatal: clone of 'https://git.xiph.org/celt.git/' into submodule path
'C:/Users/ethin/source/mumble/3rdparty/sbcelt-src/celt-0.7.0' failed
Failed to clone 'celt-0.7.0' a second time, aborting
Submodule path '3rdparty/speex-src': checked out
'ecc63b360cbf6675d905ae278776c628fdfda00a'
Submodule path '3rdparty/speexdsp-src': checked out
'a2133f5904ddb616b6578920bd2199f5accb484d'
Submodule path 'themes/Mumble': checked out
'9c68c1453837b82f69e93d7df2dbdd086d96f27d'
Failed to recurse into submodule path '3rdparty/sbcelt-src'
…On 5/27/20, Robert Adam ***@***.***> wrote:
> it seems as though its
in a sort-of stasis mode.
*was
We're already starting to increase the pace of development again :)
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#3896 (comment)
--
Signed,
Ethin D. Probst
|
Yeah we had to remove sbcelt for that reason. You should be able to just go to a branch you haven't made any changes and then run
to update to the latest and greatest version :) |
This PR adds a detection mechanism that, while primitive, prevents windows hooking when a screen reader is found to be running when Mumble is executed. This is accomplished by enumerating the process list and checking for a (currently hardcoded) set of (only two right now) screen reader binaries. I know that NVDA (denoted by image name nvda.exe) is affected when Mumble loads winhooks, but I don't know if JAWS (denoted with image name jfw.exe) is. Rather than add every screen reader I know of to this list, I feel it might be better to just add them when we come across them.
Note: I have not built this code yet. I am working on automating the build process since I am unable to do it on my local machine at this time, so expect errors. (I tried not to make any, but you know...) Also, I did my best to mantain formatting, though it wasn't easy. :)