-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
SnedMessage with WM_NCHITTEST returns HTCAPTION in the TABS #1979
Comments
I can reproduce the issue, will look into it. |
I take it back. I was testing the wrong thing. Which version of Sumatra did you test? I can't reproduce this in latest daily build https://www.sumatrapdfreader.org/dailybuilds I've enabled "Lower windows by middle clicking on title bars" and was able to close tabs with Left Mouse. I've also added logging to all handling of Can you re-test with latest daily build? |
@kjk |
I was not testing the latest daily build but a slightly older prerelease. I do not see the same than @kjk from the outside... The problem for AltDrag is only that when you middle click on a This causes no other problems than the Middle click tab closing, that can no longer work because AltDrag can not see the difference between the tab and the title bar, so AltDrag will lower the window instead of forwarding the click to Sumatra. After searching in the code base I guess the issue is maybe here? Lines 502 to 511 in af0d18c
Or maybe here? Lines 813 to 827 in af0d18c
I was not very clear, I hope this helps. |
@RamonUnch thanks for additional information. I understand it now and can reproduce. With "Lower windows..." option turned on middle click no longer closes tabs. I've added logging and I've noticed that on middle click sequence of messages is different with "Lower windows..." option turned on: Without AltDrag "Lower windows...":
With AltDrag "Lower windows...":
As you predicted, the issue is that we return However, with "Lower windows..." option turned on, AltDrag sends a message to a different window so arguably Sumatra is returning the right response. In Sumatra
The issue is that AltDrag sends WM_NCHITTEST to parent of the window:
Is this a subtle bug in AltDrag i.e. Or is there a valid reason for sending |
@kjk I will fix AltDrag then. I thought the problem was from Sumatra because other programs (such as firefox/chrome) would give the "correct" values from the ancestor hwnd. but I think you are right and there was nothing wrong with Sumatra. |
Well AltDrag is now fixed, I sent you a little donation for your efforts and your software. |
On some windows such as Sumatra PDF, or Office 2010, by avoiding to get the ancestor window before the WM_NCHITTEST message. SumatraPDF discussion: sumatrapdfreader/sumatrapdf#1979 I had to add the HitTestTimeout() function that checks the response of the WM_NCHITTEST on the pointed hwnd, if it returns HTTRANSPARENT, then I check the parent window until there is a parent or the HitTest returned something different than Transparent.
Sumatra PDF is THE perfect PDF reader for Windows.
However I encountered an issue while developing the AltDrag software RamonUnch/AltSnap#67.
The problem comes from the fact that Sumatra returns
HTCAPTION
when theWM_NCHITTEST
message is sent and the lParam points towards any of the tabs.This HTCAPTION should be returned ONLY when lParam is pointing to the title bar outside of the tabs.
When lParam points into a tab, the
HTCLIENT
value should be returned.The only other program with tabs I encountered having the same problem is MS Terminal and it will be fixed at some point microsoft/terminal#9443.
Could this be fixed for Sumatra PDF as well? this would also be potentially helpful for other accessibility tools that rely on the
WM_NCHITTEST
messaging.The text was updated successfully, but these errors were encountered: