Maelstrom: Make sure that fullscreen panels go behind dialogs

https://github.com/libsdl-org/Maelstrom/commit/8a054c16bd06430d5f2bdb30fb9a197c74e04ba9

From 8a054c16bd06430d5f2bdb30fb9a197c74e04ba9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 13 Nov 2012 21:04:23 -0800
Subject: [PATCH] Make sure that fullscreen panels go behind dialogs

---
 screenlib/UIManager.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/screenlib/UIManager.cpp b/screenlib/UIManager.cpp
index bea4187d..203ca06e 100644
--- a/screenlib/UIManager.cpp
+++ b/screenlib/UIManager.cpp
@@ -202,7 +202,13 @@ UIManager::ShowPanel(UIPanel *panel)
 			}
 		}
 
-		m_visible.add(panel);
+		// Make sure that fullscreen panels go behind dialogs
+		if (panel->IsFullscreen()) {
+			m_visible.insert(panel, 0);
+		} else {
+			m_visible.add(panel);
+		}
+
 		panel->Show();
 		if (panel->IsFullscreen()) {
 			Draw();