[Scummvm-git-logs] scummvm master -> 2b0877f3bbe7d530ac53311a64e6aa18f4a10d73

eriktorbjorn noreply at scummvm.org
Sat Oct 5 17:50:11 UTC 2024


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:
aa42c9c038 SCUMM: MACGUI: Copy the menu bar to Mac screen when a dialog is shown
2b0877f3bb SCUMM: MACGUI: Update mouse cursor on mouse up after unfocusing widget


Commit: aa42c9c0381b7e6b2e825229d4001981c7eee3e8
    https://github.com/scummvm/scummvm/commit/aa42c9c0381b7e6b2e825229d4001981c7eee3e8
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-05T19:39:45+02:00

Commit Message:
SCUMM: MACGUI: Copy the menu bar to Mac screen when a dialog is shown

This is to allow the "beam" cursor to be correctly drawn if it ever
moves that far up. There is no reason for it to, but it can happen if
you drag it outside the dialog window while selecting text.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 2ff2dbebbbf..260bd20f6bb 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -93,6 +93,17 @@ MacGuiImpl::MacDialogWindow::MacDialogWindow(MacGuiImpl *gui, OSystem *system, G
 			r.grow(-2);
 		}
 	}
+
+	// The menu bar isn't part of the Mac screen. We copy it to the Mac
+	// screen so that the beam cursor is correctly drawn if it ever moves
+	// that far up. There's no reason for it to, but it can happen.
+
+	Graphics::Surface *screen = _gui->surface();
+	Graphics::Surface *realScreen = _system->lockScreen();
+
+	screen->copyRectToSurface(*realScreen, 0, 0, Common::Rect(0, 0, 640, 19));
+
+	_system->unlockScreen();
 }
 
 MacGuiImpl::MacDialogWindow::~MacDialogWindow() {


Commit: 2b0877f3bbe7d530ac53311a64e6aa18f4a10d73
    https://github.com/scummvm/scummvm/commit/2b0877f3bbe7d530ac53311a64e6aa18f4a10d73
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-10-05T19:47:49+02:00

Commit Message:
SCUMM: MACGUI: Update mouse cursor on mouse up after unfocusing widget

If we do it before the widget is unfocused, we may end up with a beam
cursor outside of an edit widget, until the mouse moves again.

Changed paths:
    engines/scumm/macgui/macgui_dialogwindow.cpp


diff --git a/engines/scumm/macgui/macgui_dialogwindow.cpp b/engines/scumm/macgui/macgui_dialogwindow.cpp
index 260bd20f6bb..276d19f5e4d 100644
--- a/engines/scumm/macgui/macgui_dialogwindow.cpp
+++ b/engines/scumm/macgui/macgui_dialogwindow.cpp
@@ -451,7 +451,6 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 
 			case Common::EVENT_LBUTTONUP:
 				buttonPressed = false;
-				updateCursor();
 
 				// Only the focused widget receives the button
 				// up event. If the widget handles the event,
@@ -462,8 +461,6 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 				if (_focusedWidget) {
 					MacWidget *widget = _focusedWidget;
 
-					updateCursor();
-
 					if (widget->findWidget(event.mouse.x, event.mouse.y)) {
 						widgetId = widget->getId();
 						if (widget->handleMouseUp(event)) {
@@ -475,6 +472,7 @@ int MacGuiImpl::MacDialogWindow::runDialog(Common::Array<int> &deferredActionIds
 					clearFocusedWidget();
 				}
 
+				updateCursor();
 				break;
 
 			case Common::EVENT_MOUSEMOVE:




More information about the Scummvm-git-logs mailing list