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

sev- noreply at scummvm.org
Wed Aug 2 16:42:32 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:
a7e737b6e4 GRAPHICS: MACGUI: Implement background window
dc17d62416 DIRECTOR: Set underlying window to background


Commit: a7e737b6e4bc52700bc4beb93690cab286da7e51
    https://github.com/scummvm/scummvm/commit/a7e737b6e4bc52700bc4beb93690cab286da7e51
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-08-02T18:42:24+02:00

Commit Message:
GRAPHICS: MACGUI: Implement background window

This patch adds background window, these are special type of window where
the window is always in background and in a multi-window environment, it
will prevent the window from being brought to front.

Changed paths:
    graphics/macgui/macwindowmanager.cpp
    graphics/macgui/macwindowmanager.h


diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp
index 215b156a36b..66d016cf0f9 100644
--- a/graphics/macgui/macwindowmanager.cpp
+++ b/graphics/macgui/macwindowmanager.cpp
@@ -165,6 +165,7 @@ MacWindowManager::MacWindowManager(uint32 mode, MacPatterns *patterns, Common::L
 
 	_activeWidget = nullptr;
 	_lockedWidget = nullptr;
+	_backgroundWindow = nullptr;
 
 	_mouseDown = false;
 	_hoveredWidget = nullptr;
@@ -346,6 +347,10 @@ void MacWindowManager::setLockedWidget(MacWidget *widget) {
 	_lockedWidget = widget;
 }
 
+void MacWindowManager::setBackgroundWindow(MacWindow *window) {
+	_backgroundWindow = window;
+}
+
 void MacWindowManager::clearWidgetRefs(MacWidget *widget) {
 	if (widget == _hoveredWidget)
 		_hoveredWidget = nullptr;
@@ -1037,7 +1042,7 @@ bool MacWindowManager::processEvent(Common::Event &event) {
 			continue;
 		if (w->hasAllFocus() || (w->isEditable() && event.type == Common::EVENT_KEYDOWN) ||
 				w->getDimensions().contains(event.mouse.x, event.mouse.y)) {
-			if (event.type == Common::EVENT_LBUTTONDOWN || event.type == Common::EVENT_LBUTTONUP)
+			if ((event.type == Common::EVENT_LBUTTONDOWN || event.type == Common::EVENT_LBUTTONUP) && (!_backgroundWindow || w != _backgroundWindow))
 				setActiveWindow(w->getId());
 
 			return w->processEvent(event);
diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h
index d670f908bfb..afb9f0a0e98 100644
--- a/graphics/macgui/macwindowmanager.h
+++ b/graphics/macgui/macwindowmanager.h
@@ -299,6 +299,13 @@ public:
 	 * @param widget Pointer to the widget to lock, nullptr for no widget
 	 */
 	void setLockedWidget(MacWidget *widget);
+
+	/**
+	 * Sets a background window, which is always active, this window cannot be
+	 * deactivated by clicking outside it, ie it is always in background.
+	 * @param window Pointer to the widget to background, nullptr for no widget
+	 */
+	void setBackgroundWindow(MacWindow *window);
 	
 	MacPatterns  &getBuiltinPatterns() { return _builtinPatterns; }
 
@@ -456,6 +463,7 @@ private:
 
 	MacWidget *_activeWidget;
 	MacWidget *_lockedWidget;
+	MacWindow *_backgroundWindow;
 
 	PauseToken *_screenCopyPauseToken;
 


Commit: dc17d62416001f19a553a7628d043105804b58a7
    https://github.com/scummvm/scummvm/commit/dc17d62416001f19a553a7628d043105804b58a7
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-08-02T18:42:24+02:00

Commit Message:
DIRECTOR: Set underlying window to background

This patch sets the flag background for score (or main director engine)
window, It is useful because it prevents the window from jumping to front
of other windows (ie from `open` command) and thus shadowing it.

Fixes `title of window` from workshop, where clicking outside opened window
used to disappear it beneath the main window.

Also fixes 'totaldistortion-win' sequencer TV, when clicking anywhere except
the TV screen, the window used to disappear.

Changed paths:
    engines/director/director.cpp


diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index f0751ef3337..c663a1f257e 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -241,6 +241,9 @@ Common::Error DirectorEngine::run() {
 	_stage = new Window(_wm->getNextId(), false, false, false, _wm, this, true);
 	*_stage->_refCount += 1;
 
+	// Set this as background so it doesn't come to foreground when multiple windows present
+	_wm->setBackgroundWindow(_stage);
+
 	if (!desktopEnabled())
 		_stage->disableBorder();
 




More information about the Scummvm-git-logs mailing list