summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2025-04-12 16:14:04 -0700
committerDentomologist <dentomologist@gmail.com>2025-04-12 16:17:04 -0700
commit2c20d5dcd92cbd7678af4c7bf0283638e8df931b (patch)
treebc78b051ad7d7f9d2e4418eb4d000aa7fef98465 /Source/Core
parent4f210df86a2d2362ef8087cf81b817b18c3d32e9 (diff)
GameList: Ignore non-left double-clicks
Don't start a game when a double-click is triggered by a mouse button other than the left button. Fixes https://bugs.dolphin-emu.org/issues/12272.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/GameList/GameList.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp
index a4514a0449..d0b0b73993 100644
--- a/Source/Core/DolphinQt/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt/GameList/GameList.cpp
@@ -93,6 +93,25 @@ protected:
else
return QTableView::moveCursor(cursorAction, modifiers);
}
+
+ virtual void mouseDoubleClickEvent(QMouseEvent* const event) override
+ {
+ if (event->button() == Qt::LeftButton)
+ QTableView::mouseDoubleClickEvent(event);
+ }
+};
+
+class GameListListView : public QListView
+{
+public:
+ explicit GameListListView(QWidget* parent = nullptr) : QListView(parent) {}
+
+protected:
+ virtual void mouseDoubleClickEvent(QMouseEvent* const event) override
+ {
+ if (event->button() == Qt::LeftButton)
+ QListView::mouseDoubleClickEvent(event);
+ }
};
} // namespace
@@ -319,7 +338,7 @@ void GameList::resizeEvent(QResizeEvent* event)
void GameList::MakeGridView()
{
- m_grid = new QListView(this);
+ m_grid = new GameListListView(this);
m_grid->setModel(m_grid_proxy);
m_grid->setSelectionMode(QAbstractItemView::ExtendedSelection);