-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Redirect mouse events to the window under cursor, simplify popup menu input processing. #88392
base: master
Are you sure you want to change the base?
Conversation
d4f172c
to
9652711
Compare
Seems to be working on macOS (and sidecar on iOS), Windows, X11/GNOME, and in a single-window mode. Confined/Captured mode seems to work fine. As well as on Android and iOS (with touch screen instead of mouse). |
Actually, there is an extra case that probably require additional handling, and I have not accounted for: |
Added extra check for X11, should be already handled on other platforms. |
Seems to work fine for me on KDE Wayland. |
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.
Tested on Windows and it works great.
Can't comment much on the code. Though I wonder if calling get_window_at_screen_position()
for every mouse event won't affect performance.
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.
This PR is unifying the behavior of different display servers, which is a step in the right direction.
I have tested this PR rebased on 8f0c20e on Linux X11 Xfce in two scenarios.
The root window is not embedding windows (single window mode off)
I can confirm, that it fixes: #88324, #77246 and #66273
I was unable to recreate #73926 (not on platform:Linux) and #70361 (interference from #88324) in current master.
Currently (8f0c20e) it is possible to drag and drop from a secondary window to the root window. With this PR, this functionality is no longer possible. This can be verified in the editor by making the FileSystem dock floating and trying to drag and drop the icon.svg
into the respective slot in the Inspector of a Sprite2D
node.
I have tested this PR rebased on #67531 and found, that merging this PR will make changes to the other PR necessary. Don't merge at the same time!
The root window is embedding windows (single window mode on)
I can confirm, that it fixes: #66273
The PR doesn't resolve issue #70361 and #77246 for me.
I was unable to recreate #73926 (not on platform:Linux) and #88324 (native windows only) in current master.
@Sauermann Are you using Windows 10 or 11? I'm not able to reproduce #88324 on Windows 10, but I can confirm the PR fixes #73926 and #70361 for me. |
@KoBeWi Please note, that I have tested this on Linux. |
Ah ok, I misunderstood your comment. |
I was able to reproduce #88324 on windows 11 and this PR has solved the issue for me. |
Did some testing on Linux, I think I mostly have the same results as @Sauermann. I wrote them in each relevant issue to keep things a bit clearer about what is reproducible in I confirm this PR fixes #88324 and #66273. For me #70361 is only reproducible in single-window mode, and this PR doesn't fix it on Linux. Does it fix it on Windows for single-window mode? If not, we might want to keep the issue open for single-window mode, or open a new one. Likewise for #77246, it seems specific to single-window mode on Linux, and this PR doesn't fix it. |
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.
I think this is good to go, but we might need to clarify whether all the listed bugs should indeed be closed or not, as some aspects of them are still reproducible at least on Linux + single-window mode.
I can also confirm that the Popup behaviour is much better with this PR. What I'm wondering here: When I debugged this issue on Windows, I saw weird or even wrong behaviour what |
Don't miss @Sauermann's comment:
That's a regerssion. |
This does not actually fixes #88324 but it helps working around it. The root cause of the issue is still there, but this reduces the chances to trigger the bug. See #88324 (comment) |
On Windows 10.0.22621. This breaks drag and drop between multiple windows for me as well.
I cannot reproduce #88324, but I believe that is a separate timing issue, since this PR changes popups to need mouse up. |
I Just have some concerns related to the changes in the popup menu class. |
I think it will be easier to backup your popup menu changes and you submit them later on another pull request after merging my pull request to avoid rebasing and conflict. Since most of the popup menu issues have been fixed after reverting and more issues was fixed in my pull request. |
…u input processing.
This still breaks multi-window drag and drop. Fixes:
Only fixes in multiple window mode:
#88324 is already fixed. |
Needs a rebase since #67531 got merged. |
Redirect mouse events to the window under cursor, simplify popup menu input processing.
PopupMenu
input handling.Fixes #88324
Fixes #70361
Fixes #77246
Fixes #66273
Fixes #73926
Supersede #85583
Supersede #88366
Supersede #88342