浏览代码

Merge pull request #16164 from aws-lumberyard-dev/13990_AssetBrowser_Renaming

Check that AssetBrowser is focused before auto renaming.
sphrose 2 年之前
父节点
当前提交
17dacb028d
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp

+ 7 - 0
Code/Editor/AzAssetBrowser/AzAssetBrowserWindow.cpp

@@ -329,6 +329,13 @@ AzAssetBrowserWindow::AzAssetBrowserWindow(QWidget* parent)
         this,
         [this](const QModelIndex& index)
         {
+            // If multiple AssetBrowsers are open, only the focused browser should perform the rename.
+            QWidget* focusWidget = QApplication::focusWidget();
+            if (!isAncestorOf(focusWidget))
+            {
+                return;
+            }
+
             if (m_ui->m_thumbnailView->GetThumbnailActiveView())
             {
                 m_ui->m_thumbnailView->OpenItemForEditing(index);