[Scummvm-git-logs] scummvm master -> bfc87720de745ad9bb549158588520a3188f3973

lephilousophe noreply at scummvm.org
Sun Jun 18 18:40:04 UTC 2023


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

Summary:
c276e89888 GUI: Don't display tooltips while dragging mouse
bfc87720de GUI: Fix bug #7124


Commit: c276e8988892d42d2283d4f0ad8c4920f2a8ce43
    https://github.com/scummvm/scummvm/commit/c276e8988892d42d2283d4f0ad8c4920f2a8ce43
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-06-18T20:39:59+02:00

Commit Message:
GUI: Don't display tooltips while dragging mouse

Displaying it cancels the dragging.

Changed paths:
    gui/dialog.h
    gui/gui-manager.cpp


diff --git a/gui/dialog.h b/gui/dialog.h
index 699c28829cd..06eba26c25b 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -82,6 +82,8 @@ public:
 	void	setFocusWidget(Widget *widget);
 	Widget *getFocusWidget() { return _focusedWidget; }
 
+	bool isDragging() const { return _dragWidget != nullptr; }
+
 	void setTickleWidget(Widget *widget) { _tickleWidget = widget; }
 	void unSetTickleWidget() { _tickleWidget = nullptr; }
 	Widget *getTickleWidget() { return _tickleWidget; }
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index abad4cf36cf..1398b633f34 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -539,7 +539,8 @@ void GuiManager::runLoop() {
 		//    then delay showing the tooltip based on the value of kTooltipSameWidgetDelay.
 		uint32 systemMillisNowForTooltipCheck = _system->getMillis(true);
 		if ((_lastTooltipShown.x != _lastMousePosition.x || _lastTooltipShown.y != _lastMousePosition.y)
-		    && _lastMousePosition.time + kTooltipDelay < systemMillisNowForTooltipCheck) {
+		    && _lastMousePosition.time + kTooltipDelay < systemMillisNowForTooltipCheck
+		    && !activeDialog->isDragging()) {
 			Widget *wdg = activeDialog->findWidget(_lastMousePosition.x, _lastMousePosition.y);
 			if (wdg && wdg->hasTooltip() && !(wdg->getFlags() & WIDGET_PRESSED)
 			    && (_lastTooltipShown.wdg != wdg || _lastTooltipShown.time + kTooltipSameWidgetDelay < systemMillisNowForTooltipCheck)) {


Commit: bfc87720de745ad9bb549158588520a3188f3973
    https://github.com/scummvm/scummvm/commit/bfc87720de745ad9bb549158588520a3188f3973
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-06-18T20:39:59+02:00

Commit Message:
GUI: Fix bug #7124

A fake mouse moved event is generated to force a refresh of the current
hovered widget

Changed paths:
    gui/dialog.cpp


diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 74eb4516749..dfda0bbf71b 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -232,7 +232,11 @@ void Dialog::handleMouseUp(int x, int y, int button, int clickCount) {
 	if (w)
 		w->handleMouseUp(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button, clickCount);
 
-	_dragWidget = nullptr;
+	if (_dragWidget) {
+		_dragWidget = nullptr;
+		// Fake a mouse move to refresh now hovered widget
+		handleMouseMoved(x, y, button);
+	}
 }
 
 void Dialog::handleMouseWheel(int x, int y, int direction) {




More information about the Scummvm-git-logs mailing list