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
fix: non-client mouse events on WCO-enabled windows #32871
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zcbenz
approved these changes
Feb 16, 2022
clavin
force-pushed
the
clavin/fix-wco-drag
branch
3 times, most recently
from
March 1, 2022 22:21
e7506e3
to
7ee6dda
Compare
codebytere
approved these changes
Mar 1, 2022
clavin
force-pushed
the
clavin/fix-wco-drag
branch
from
March 7, 2022 19:04
c12fa55
to
afbe96d
Compare
jkleinsc
approved these changes
Mar 8, 2022
Release Notes Persisted
|
This was referenced Mar 8, 2022
I have automatically backported this PR to "15-x-y", please check out #33199 |
I have automatically backported this PR to "16-x-y", please check out #33200 |
I have automatically backported this PR to "17-x-y", please check out #33201 |
I have automatically backported this PR to "18-x-y", please check out #33202 |
3 tasks
3 tasks
3 tasks
bavulapati
pushed a commit
to bavulapati/electron
that referenced
this pull request
Apr 29, 2022
khalwa
pushed a commit
to solarwindscloud/electron
that referenced
this pull request
Feb 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
My change in #32672 caused a regression where WCO-enabled windows (on Windows) could no longer be dragged. This is because in
HWNDMessageHandler::HandleMouseEventInternal
,HandleMouseEvent
(which is what I patched in the previous PR) is called beforeHandleMouseInputForCaption
(which is where the dragging happens I think, from testing). Instead of trying to patch in something to move the marking of the event as handled further down, I opted instead to try and fix the issue withLegacyRenderWidgetHostHWND
.This PR introduces a patch that does two things, particularly only for WCO-enabled windows right now:
DefWindowProc
using the parent window handle (GetParent()
), it is instead called on its own window handle. This seems to avoid the issue with a mysteriousWM_NCMOUSELEAVE
message being generated by theDefWindowProc
.This should be safe to do since the
LegacyRenderWidgetHostHWND
doesn't normally cover the non-client area in windows without hidden title bars (thus never reaching this code) and for frameless windows this is the same code path. Thus the change should only apply to WCO-enabled windows. I also think the code is still correct since it is the job ofLegacyRenderWidgetHostHWND
to forward messages to its parent window anyways.I know this is a patch which we usually try to avoid those, however I don't really see an alternative for either possible solution without making a patch. I'll try to upstream this, but if that fails the only other way to remove this patch would be when
LegacyRenderWidgetHostHWND
is finally removed (see its header comments for more info on that; doesn't look very defined though).Checklist
npm test
passes (letting CI check)Release Notes
Notes: Fixed drag regions on WCO windows on Windows