Fix keyboard focus after dropping parts from floating docks

Dragging a part from a floating Parts window can leave that window active after the drop. Setting focus on the model view alone does not activate its window, so movement shortcuts remain in the Parts list until the model is clicked.

Activate the receiving window before focusing the view after accepted part or color drops so keyboard commands can reach the model immediately.

Fixes #1040.
This commit is contained in:
Leonardo Zide committed 2026-10-23 14:42:54 -07:00
1 parent 688859b120
commit c6dd2c45c1
1 file changed
+1
+1
View File
@@ -370,6 +370,7 @@ void lcViewWidget::dropEvent(QDropEvent* DropEvent)
if (MimeData->hasFormat("application/vnd.leocad-part") || MimeData->hasFormat("application/vnd.leocad-color"))
{
mView->EndDrag(true);
window()->activateWindow();
setFocus(Qt::MouseFocusReason);
DropEvent->accept();