Skip to content
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

Prevent selecting the hovered node if the mouse is not inside the inspector dock #96124

Merged

Conversation

AeioMuch
Copy link
Contributor

@AeioMuch AeioMuch commented Aug 26, 2024

Fix #94320
Also fixed the fact that the hovered&inspected node was not added to the selection history.

It will only select the hovered&inspected node if the mouse is inside the inspector at the end of the drag.
To reinspect the current selection, I went with the method of reselecting everything. Sadly selecting nodes is a bit slow if you select a lot of them, but that's a general issue.

I also moved the code that was happening when the mouse button was released, inside the NOTIFICATION_DRAG_END instead, to centralize stuff more. This made me realize there was a duplicate call to _reset_hovering_timer() left, and also a signal connection that was useless (_reset_hovering_timer() is already called in _handle_hover_to_inspect() anyway), and more importantly not connected to correct thing so it was not working.

@AeioMuch AeioMuch requested a review from a team as a code owner August 26, 2024 16:58
@AThousandShips AThousandShips added bug topic:editor cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Aug 26, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Aug 26, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Sep 8, 2024

Something is wrong:

godot.windows.editor.dev.x86_64_qNPYLuaKYp.mp4

The selection goes back to dragged node even if it's assigned.

@AeioMuch AeioMuch force-pushed the check_mouse_pos_inside_inspector branch 2 times, most recently from 6fcbe97 to 8c977ee Compare September 8, 2024 20:45
@AeioMuch
Copy link
Contributor Author

AeioMuch commented Sep 8, 2024

Ah, thank you for noticing that! It looks like the check to see if the mouse is inside was off somehow. I was always testing to drop in a property that was not at the top, and that worked, but indeed when the mouse was at the top it was considered outside the inspector dock. I made some changes and it look to work properly now, also tested with the inspector dock floating and it worked also.

@AeioMuch AeioMuch force-pushed the check_mouse_pos_inside_inspector branch from 8c977ee to 5848d72 Compare September 9, 2024 04:58
@akien-mga akien-mga merged commit 0fd62f7 into godotengine:master Oct 1, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release topic:editor
Projects
None yet
4 participants