Skip to content

Commit 30a19a5

Browse files
committed
Make mouse_focus and mouse_focus_mask consistent for force_drag
In `Viewport::_gui_force_drag` currently `Viewport::gui.mouse_focus` gets cleared, but `Viewport::gui.mouse_focus_mask` doesn't get cleared. This is an inconsistency which can cause a crash. With the change of this PR, `mouse_focus_mask` also gets cleared. This is in alignment with how regular drag and drop clears both variables.
1 parent 92e726d commit 30a19a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

scene/main/viewport.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,7 @@ void Viewport::_gui_force_drag(Control *p_base, const Variant &p_data, Control *
23182318
gui.dragging = true;
23192319
gui.drag_data = p_data;
23202320
gui.mouse_focus = nullptr;
2321+
gui.mouse_focus_mask.clear();
23212322

23222323
if (p_control) {
23232324
_gui_set_drag_preview(p_base, p_control);

0 commit comments

Comments
 (0)