-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
System menu for Terminal shows up on wrong monitor #15421
Comments
Okay, I see what's going on. You are manually showing the system menu at the upper left corner of the GetWindowRect and didn't take into account the fact that maximized windows have borders which extend beyond the monitor. It never occurred to me that you would try to show the system menu yourself instead of just letting DefWindowProc do it. (Why not just let DefWindowProc do it?) This also explains why the system menu shows too high. Regular apps show the system menu below the caption, but Terminal shows it over the caption. Put the system menu at the upper left client pixel (not the upper left window pixel) and I think you'll be all good again. |
I've developed a fix for this issue. I tweaked the position calculations for the system menu, and now it behaves properly. I also added a bunch of error checking and error logging. Thanks for the pointers @oldnewthing! I've tested manually all the cases that were working just fine before (and they're still good, no worries there) and also with the situations that were causing trouble. Happy to say it's all working correctly now. I've run the TAEF tests too, and everything came out clean. I also checked the fullscreen mode (F11), and it's all good. I lack insight into why DefWindowProc doesn't open system menu, but that is recognized in code:
Maybe @zadjii-msft can help here; it may be the same reason why some events have to be routed manually. I was also wondering if this behavior of "borders which extend beyond the monitor" is caused by backward compatibility from DUI or DWM... Anyway, I'd like to go ahead and create a PR with the fix if that's OK? |
Ping. |
Oh, sorry @michalnpl! Mike went on paternity leave recently. I'm certain this is a fine fix--it is at least better than what we have--and would be glad to see it in PR. Please do.
As we always say, "I think there was a reason!" This was probably an early casualty of the weird stuff we had to do to interact with the DirectInput capture site that was making our lives difficult when we moved the tabs into the non-client area1.
Footnotes
|
Thanks @DHowett , PR created. |
From MSFT:41390752, courtesy of @oldnewthing
The text was updated successfully, but these errors were encountered: