[Scummvm-git-logs] scummvm master -> 40d6a3aa8a72fbfa6308b8feca2744df3d08138a

sev- noreply at scummvm.org
Sun Sep 28 11:57:56 UTC 2025


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

Summary:
40d6a3aa8a GRAPHICS: MACGUI: Disable select all on MacText activation for MacTextWindow


Commit: 40d6a3aa8a72fbfa6308b8feca2744df3d08138a
    https://github.com/scummvm/scummvm/commit/40d6a3aa8a72fbfa6308b8feca2744df3d08138a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-28T13:55:59+02:00

Commit Message:
GRAPHICS: MACGUI: Disable select all on MacText activation for MacTextWindow

Fixes text clearing in WAGE engine console window.

We were selecting whole text on widget activation, and then with a keystroke,
selection got cleared up. That led to inconsistent user experience,
particularly when switching from the Scene window to Console window

Changed paths:
    graphics/macgui/mactext.cpp
    graphics/macgui/mactext.h
    graphics/macgui/mactextwindow.cpp


diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 38716edc41f..a3e881dab04 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -238,6 +238,7 @@ void MacText::init(uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textA
 	_selectable = false;
 
 	_editableRow = 0;
+	_autoSelect = true;
 
 	_menu = nullptr;
 
@@ -715,7 +716,7 @@ void MacText::setActive(bool active) {
 	MacWidget::setActive(active);
 
 	g_system->getTimerManager()->removeTimerProc(&cursorTimerHandler);
-	if (_active) {
+	if (_active && _autoSelect) {
 		g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 200000, this, "macEditableText");
 		// inactive -> active, we reset the selection
 		setSelection(_selStart, true);
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 2e44447b71e..a12a5697c20 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -64,6 +64,8 @@ public:
 	void setScrollBar(bool enable);
 	void resizeScrollBar(int w, int h);
 
+	void setAutoSelect(bool enable) { _autoSelect = enable; }
+
 	void render();
 	void undrawCursor();
 	void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff);
@@ -249,6 +251,8 @@ private:
 	bool _selectionIsDirty;
 
 	MacMenu *_menu;
+
+	bool _autoSelect;
 };
 
 int getStringWidth(MacFontRun &format, const Common::U32String &str);
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp
index f1ef180f331..45b589f100a 100644
--- a/graphics/macgui/mactextwindow.cpp
+++ b/graphics/macgui/mactextwindow.cpp
@@ -71,6 +71,9 @@ void MacTextWindow::init() {
 
 	_textColorRGB = 0;
 
+	// Disable autoselect on activation
+	_mactext->setAutoSelect(false);
+
 	if (_wm->_mode & kWMModeWin95) {
 		// in win95 mode, we set scrollbar as default
 		_hasScrollBar = true;




More information about the Scummvm-git-logs mailing list