[Scummvm-git-logs] scummvm master -> 69b9f8e231bf0a2e3f041bf0ee67c3678fcf4a90

sev- noreply at scummvm.org
Fri May 3 21:53:18 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
69b9f8e231 GUI: Implement handleMouseUp for Grid layout


Commit: 69b9f8e231bf0a2e3f041bf0ee67c3678fcf4a90
    https://github.com/scummvm/scummvm/commit/69b9f8e231bf0a2e3f041bf0ee67c3678fcf4a90
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-05-03T23:53:15+02:00

Commit Message:
GUI: Implement handleMouseUp for Grid layout

This makes it so that games are started on the release
of the left mouse button after a double click, instead of
during it being pressed.
This fixes the left mouse button release leaking into the
launched game as actual engine input.

Changed paths:
    gui/widgets/grid.cpp
    gui/widgets/grid.h


diff --git a/gui/widgets/grid.cpp b/gui/widgets/grid.cpp
index 085f5eb03bd..99b05c23915 100644
--- a/gui/widgets/grid.cpp
+++ b/gui/widgets/grid.cpp
@@ -320,7 +320,12 @@ void GridItemTray::handleMouseDown(int x, int y, int button, int clickCount) {
 	if ((x < 0 || x > _w) || (y > _h || y < -(_grid->_gridItemHeight))) {
 		// Close on clicking outside
 		close();
-	} else if (y < 0 && clickCount >= 2) {
+	}
+}
+
+void GridItemTray::handleMouseUp(int x, int y, int button, int clickCount) {
+	Dialog::handleMouseUp(x, y, button, clickCount);
+	if (y < 0 && clickCount >= 2) {
 		// Run on double clicking thumbnail
 		close();
 		sendCommand(kItemDoubleClickedCmd, _entryID);
diff --git a/gui/widgets/grid.h b/gui/widgets/grid.h
index e745cf0a700..f2d693c1201 100644
--- a/gui/widgets/grid.h
+++ b/gui/widgets/grid.h
@@ -90,6 +90,7 @@ public:
 
 	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
 	void handleMouseDown(int x, int y, int button, int clickCount) override;
+	void handleMouseUp(int x, int y, int button, int clickCount) override;
 	void handleMouseWheel(int x, int y, int direction) override;
 	void handleMouseMoved(int x, int y, int button) override;
 };




More information about the Scummvm-git-logs mailing list