diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/DmdBridgePlayer.cs b/VisualPinball.Engine.DMD.Unity/Runtime/DmdBridgePlayer.cs
index cffaeab..cdf9101 100644
--- a/VisualPinball.Engine.DMD.Unity/Runtime/DmdBridgePlayer.cs
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/DmdBridgePlayer.cs
@@ -116,12 +116,15 @@ public class DmdBridgePlayer : MonoBehaviour, IDiagnosticsSource
private DmdBridgeSettings _settings;
private DmdBridgeSettings _appliedSettings;
private DmdBridgeSettings _lastFallbackSettings;
+ /// The stacking set on the component over the INI's, until the INI changes; null while the INI's holds.
+ private bool? _stayOnTopOverride;
private DateTime _appliedConfigWriteTimeUtc;
private string _appliedConfigPath;
private bool _missingDisplayWarningLogged;
private bool _nativeWindowWarningLogged;
private bool _missingConfigWarningLogged;
private float _nextNativeWindowLayoutSyncTime;
+ private float _nextRestackTime;
private float _suppressNativeWindowLayoutSyncUntil;
private bool _defaultAltColorPathResolved;
private string _defaultAltColorPath;
@@ -237,7 +240,12 @@ private void Update()
{
// Drives a host-pumped native window (macOS/SDL) on the main thread; no-op on the
// self-driven Windows backend. Must run every frame.
- (_managed ? _managedInput?.Pipeline as DmdPipeline : _pipeline)?.PumpMainThread();
+ var pipeline = _managed ? _managedInput?.Pipeline as DmdPipeline : _pipeline;
+ pipeline?.PumpMainThread();
+ if (pipeline != null && Time.unscaledTime >= _nextRestackTime) {
+ _nextRestackTime = Time.unscaledTime + SettingsCheckInterval;
+ pipeline.RestackNativeWindows(_settings?.NativeWindowStayOnTop ?? false);
+ }
if (_managed || PlayerIntegrationMode.HostManaged) return;
// Settings (component fields + DmdDevice.ini) change rarely; checking ~4x/sec keeps the
@@ -739,6 +747,10 @@ private DmdBridgeSettings LoadSettings()
Logger.Info("[DMD] No DmdDevice.ini found at {Path:l}, using component settings.", configPath);
_missingConfigWarningLogged = true;
}
+ // without the INI only the component counts, and a restored INI is read anew
+ _appliedConfigPath = null;
+ _appliedConfigWriteTimeUtc = default;
+ _stayOnTopOverride = null;
_lastFallbackSettings = fallback.Clone();
return fallback;
}
@@ -755,12 +767,18 @@ private DmdBridgeSettings LoadSettings()
return _settings;
}
+ var iniChanged = !string.Equals(_appliedConfigPath, configPath, StringComparison.Ordinal) || _appliedConfigWriteTimeUtc != writeTimeUtc;
_appliedConfigPath = configPath;
_appliedConfigWriteTimeUtc = writeTimeUtc;
var fallbackChanged = _lastFallbackSettings != null && !fallback.Equals(_lastFallbackSettings);
var settings = DmdBridgeConfig.Load(configPath, fallback);
+ if (iniChanged) {
+ // the INI was edited since: what it says now holds, as for the rest of the presentation, unless the
+ // stacking also changed on the component
+ _stayOnTopOverride = null;
+ }
if (fallbackChanged) {
- CopyPresentationSettings(fallback, settings);
+ _stayOnTopOverride = ApplyComponentPresentation(_lastFallbackSettings, fallback, settings, _stayOnTopOverride);
}
_lastFallbackSettings = fallback.Clone();
return settings;
@@ -874,7 +892,9 @@ private void SyncNativeWindowLayout()
}
_nextNativeWindowLayoutSyncTime = Time.unscaledTime + 0.15f;
- if (!_pipeline.TryReadNativeWindowLayout(out var left, out var top, out var width, out var height, out var stayOnTop, out var isMovingOrSizing)
+ // the window's stacking isn't the user's to change there, and over the player's window it's kept on top whatever
+ // the setting: only where it was moved to goes back into the settings
+ if (!_pipeline.TryReadNativeWindowLayout(out var left, out var top, out var width, out var height, out _, out var isMovingOrSizing)
|| isMovingOrSizing) {
return;
}
@@ -882,8 +902,7 @@ private void SyncNativeWindowLayout()
if (_nativeWindowLeft == left
&& _nativeWindowTop == top
&& _nativeWindowWidth == width
- && _nativeWindowHeight == height
- && _nativeWindowStayOnTop == stayOnTop) {
+ && _nativeWindowHeight == height) {
return;
}
@@ -891,13 +910,13 @@ private void SyncNativeWindowLayout()
_nativeWindowTop = top;
_nativeWindowWidth = width;
_nativeWindowHeight = height;
- _nativeWindowStayOnTop = stayOnTop;
- CopyPresentationSettingsTo(_settings);
- CopyPresentationSettingsTo(_appliedSettings);
- CopyPresentationSettingsTo(_lastFallbackSettings);
+ CopyNativeWindowBoundsTo(_settings);
+ CopyNativeWindowBoundsTo(_appliedSettings);
+ CopyNativeWindowBoundsTo(_lastFallbackSettings);
}
- private void CopyPresentationSettingsTo(DmdBridgeSettings settings)
+ // Not the stacking: that stays what the settings say, which can come from DmdDevice.ini rather than this component.
+ private void CopyNativeWindowBoundsTo(DmdBridgeSettings settings)
{
if (settings == null) {
return;
@@ -907,7 +926,25 @@ private void CopyPresentationSettingsTo(DmdBridgeSettings settings)
settings.NativeWindowTop = _nativeWindowTop;
settings.NativeWindowWidth = _nativeWindowWidth;
settings.NativeWindowHeight = _nativeWindowHeight;
- settings.NativeWindowStayOnTop = _nativeWindowStayOnTop;
+ }
+
+ ///
+ /// The component's look and placement over what DmdDevice.ini says, once one of the component's settings changed.
+ /// The stacking only once it was changed on the component: the window's own isn't read back into the component,
+ /// so its value can still be the default under an INI's stayontop. Changed there, it holds through the
+ /// component's other changes.
+ ///
+ /// The stacking changed on the component before, null if it wasn't
+ /// The stacking changed on the component so far, null if it wasn't
+ internal static bool? ApplyComponentPresentation(DmdBridgeSettings previous, DmdBridgeSettings component, DmdBridgeSettings target, bool? stayOnTopOverride)
+ {
+ var stayOnTop = target.NativeWindowStayOnTop;
+ CopyPresentationSettings(component, target);
+ if (previous == null || component.NativeWindowStayOnTop != previous.NativeWindowStayOnTop) {
+ return component.NativeWindowStayOnTop;
+ }
+ target.NativeWindowStayOnTop = stayOnTopOverride ?? stayOnTop;
+ return stayOnTopOverride;
}
private static void CopyPresentationSettings(DmdBridgeSettings source, DmdBridgeSettings target)
diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/DmdPipeline.cs b/VisualPinball.Engine.DMD.Unity/Runtime/DmdPipeline.cs
index 0577db1..1eb52a6 100644
--- a/VisualPinball.Engine.DMD.Unity/Runtime/DmdPipeline.cs
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/DmdPipeline.cs
@@ -177,6 +177,21 @@ public void ApplySettings(DmdBridgeSettings settings)
}
}
+ ///
+ /// Keeps the native windows above the player's window where they lie over it, wherever they were moved, and gives the
+ /// others the stacking set for them.
+ ///
+ public void RestackNativeWindows(bool stayOnTop)
+ {
+ foreach (var destination in _destinations) {
+ if (destination is INativeDmdWindow window && !window.IsMovingOrSizing) {
+ int left = window.WindowLeft, top = window.WindowTop, width = window.WindowWidth, height = window.WindowHeight;
+ bool onTop = PlayerWindow.OnTop(stayOnTop, left, top, width, height);
+ if (window.WindowStayOnTop != onTop) window.ConfigureWindow(new DmdWindowLayout(left, top, width, height, onTop));
+ }
+ }
+ }
+
public bool TryReadNativeWindowLayout(out int left, out int top, out int width, out int height, out bool stayOnTop, out bool isMovingOrSizing)
{
foreach (var destination in _destinations) {
diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/NativeWindowDestinationFactory.cs b/VisualPinball.Engine.DMD.Unity/Runtime/NativeWindowDestinationFactory.cs
index 6d3f000..76b16bf 100644
--- a/VisualPinball.Engine.DMD.Unity/Runtime/NativeWindowDestinationFactory.cs
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/NativeWindowDestinationFactory.cs
@@ -35,7 +35,7 @@ public static DmdWindowLayout CreateLayout(DmdBridgeSettings settings)
settings.NativeWindowTop,
settings.NativeWindowWidth,
settings.NativeWindowHeight,
- settings.NativeWindowStayOnTop);
+ PlayerWindow.OnTop(settings.NativeWindowStayOnTop, settings.NativeWindowLeft, settings.NativeWindowTop, settings.NativeWindowWidth, settings.NativeWindowHeight));
}
public static DmdWindowStyle CreateStyle(DmdBridgeSettings settings)
diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs b/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs
new file mode 100644
index 0000000..ef919c1
--- /dev/null
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs
@@ -0,0 +1,78 @@
+// Visual Pinball Engine
+// Copyright (C) 2026 freezy and VPE Team
+//
+// SPDX-License-Identifier: MIT
+// Licensed under MIT. See https://opensource.org/license/mit.
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+using UnityEngine;
+
+namespace VisualPinball.Engine.DMD.Unity
+{
+ ///
+ /// The window the player draws the game in, which the native DMD window must stay above where they overlap. Without
+ /// "Keep on top", the player's window covered it each time it took the focus, such as when the game started.
+ ///
+ internal static class PlayerWindow
+ {
+ private const string UnityWindowClass = "UnityWndClass"; // the player's own; the DMD's and other outputs' have their own
+ private static IntPtr _window;
+
+ /// Whether the native DMD window stays on top: as set, and always where it lies over the player's window.
+ internal static bool OnTop(bool stayOnTop, RectInt window, RectInt? player)
+ => stayOnTop || player is { } bounds && bounds.Overlaps(window);
+
+ internal static bool OnTop(bool stayOnTop, int left, int top, int width, int height)
+ => stayOnTop || OnTop(false, new RectInt(left, top, width, height), Bounds());
+
+ ///
+ /// Where the player's window is on the desktop, in physical pixels. Null in the editor, on other platforms, while it is
+ /// minimized or hidden, and in exclusive fullscreen, which no window shows over, like the Player's own outputs.
+ ///
+ internal static RectInt? Bounds()
+ {
+ try {
+ if (Application.platform != RuntimePlatform.WindowsPlayer || Screen.fullScreenMode == FullScreenMode.ExclusiveFullScreen) return null;
+ if (_window == IntPtr.Zero || !IsWindow(_window)) _window = Find();
+ if (_window == IntPtr.Zero || !IsWindowVisible(_window) || IsIconic(_window)) return null;
+ // what shows of it: a framed window's rectangle takes in the resize borders, which are invisible, so a DMD
+ // right next to it would count as over it
+ if (DwmGetWindowAttribute(_window, ExtendedFrameBounds, out var rect, Marshal.SizeOf()) != 0
+ && !GetWindowRect(_window, out rect)) return null;
+ return new RectInt(rect.Left, rect.Top, rect.Right - rect.Left, rect.Bottom - rect.Top);
+ } catch (Exception) {
+ return null; // off the main thread, where Unity's screen can't be asked: the next restack on it decides
+ }
+ }
+
+ private static IntPtr Find()
+ {
+ uint process = (uint)System.Diagnostics.Process.GetCurrentProcess().Id;
+ var found = IntPtr.Zero;
+ var name = new StringBuilder(64);
+ EnumWindows((window, _) => {
+ GetWindowThreadProcessId(window, out uint owner);
+ if (owner != process) return true;
+ name.Clear();
+ if (GetClassName(window, name, name.Capacity) == 0 || name.ToString() != UnityWindowClass) return true;
+ found = window;
+ return false;
+ }, IntPtr.Zero);
+ return found;
+ }
+
+ [StructLayout(LayoutKind.Sequential)] private struct NativeRect { public int Left, Top, Right, Bottom; }
+ private delegate bool EnumWindowsProc(IntPtr window, IntPtr data);
+ [DllImport("user32.dll")] private static extern bool EnumWindows(EnumWindowsProc callback, IntPtr data);
+ [DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(IntPtr window, out uint process);
+ [DllImport("user32.dll", CharSet = CharSet.Unicode)] private static extern int GetClassName(IntPtr window, StringBuilder name, int count);
+ [DllImport("user32.dll")] private static extern bool IsWindow(IntPtr window);
+ [DllImport("user32.dll")] private static extern bool IsWindowVisible(IntPtr window);
+ [DllImport("user32.dll")] private static extern bool IsIconic(IntPtr window);
+ [DllImport("user32.dll")] private static extern bool GetWindowRect(IntPtr window, out NativeRect rect);
+ private const int ExtendedFrameBounds = 9; // DWMWA_EXTENDED_FRAME_BOUNDS
+ [DllImport("dwmapi.dll")] private static extern int DwmGetWindowAttribute(IntPtr window, int attribute, out NativeRect rect, int size);
+ }
+}
diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs.meta b/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs.meta
new file mode 100644
index 0000000..a753189
--- /dev/null
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/PlayerWindow.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: da6b97f13f54fba44815b7191b828a22
\ No newline at end of file
diff --git a/VisualPinball.Engine.DMD.Unity/Runtime/Plugins/DmdPluginFactory.cs b/VisualPinball.Engine.DMD.Unity/Runtime/Plugins/DmdPluginFactory.cs
index 0f3033a..757ac06 100644
--- a/VisualPinball.Engine.DMD.Unity/Runtime/Plugins/DmdPluginFactory.cs
+++ b/VisualPinball.Engine.DMD.Unity/Runtime/Plugins/DmdPluginFactory.cs
@@ -47,6 +47,7 @@ private static PluginField Hardware(string id, string label, SettingKind kind, J
{
var field = Field(id, label, kind, value, provider, minimum, maximum); field.Scope = ConfigurationScope.GlobalOnly; return field;
}
+ private static PluginField Describe(PluginField field, string description) { field.Description = description; return field; }
private static PluginField Coordinate(string id, string label, string row, int value, double? minimum = null, double? maximum = null)
{
var field = Field(id, label, SettingKind.Integer, value, minimum: minimum, maximum: maximum); field.Row = row; return field;
@@ -63,7 +64,7 @@ private static PluginField Coordinate(string id, string label, string row, int v
Field("EnableNativeWindow", "Native borderless window", SettingKind.Boolean, false),
Coordinate("NativeWindowLeft", "Left", "native-position", 100), Coordinate("NativeWindowTop", "Top", "native-position", 100),
Coordinate("NativeWindowWidth", "Width", "native-size", 512, minimum: 1, maximum: 16384), Coordinate("NativeWindowHeight", "Height", "native-size", 128, minimum: 1, maximum: 16384),
- Field("NativeWindowStayOnTop", "Keep on top", SettingKind.Boolean, false), Field("FlipHorizontally", "Mirror horizontally", SettingKind.Boolean, false)),
+ Describe(Field("NativeWindowStayOnTop", "Keep on top", SettingKind.Boolean, false), "Keeps the window above other applications. Over the player's own window it always stays on top, except in exclusive fullscreen."), Field("FlipHorizontally", "Mirror horizontally", SettingKind.Boolean, false)),
new PluginSettingsGroup("Cabinet hardware", "Outputs are acquired exclusively. A disabled plugin opens no device.",
Hardware("EnableZeDmd", "ZeDMD", SettingKind.Boolean, false), Hardware("ZeDmdPort", "ZeDMD port", SettingKind.Text, ""), Hardware("ZeDmdBrightness", "ZeDMD brightness", SettingKind.Integer, 8, minimum: 0, maximum: 15), Hardware("ZeDmdDebug", "ZeDMD diagnostics", SettingKind.Boolean, false),
Hardware("EnablePinDmd3", "PinDMD 3", SettingKind.Boolean, false), Hardware("PinDmd3Port", "PinDMD 3 port", SettingKind.Text, ""),
diff --git a/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs b/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs
new file mode 100644
index 0000000..482679d
--- /dev/null
+++ b/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs
@@ -0,0 +1,135 @@
+// Visual Pinball Engine
+// Copyright (C) 2026 freezy and VPE Team
+// SPDX-License-Identifier: MIT
+using System;
+using System.IO;
+using System.Reflection;
+using NUnit.Framework;
+using UnityEngine;
+using VisualPinball.Engine.DMD.Unity;
+using Object = UnityEngine.Object;
+
+namespace VisualPinball.Engine.DMD.Tests
+{
+ public sealed class NativeWindowStackingTests
+ {
+ private static readonly RectInt Player = new(0, 0, 1920, 1080);
+
+ private static bool OnTop(bool stayOnTop, RectInt window, RectInt? player)
+ {
+ var type = typeof(VisualPinball.Engine.DMD.Unity.DmdBridgeSettings).Assembly.GetType("VisualPinball.Engine.DMD.Unity.PlayerWindow", true);
+ var method = type.GetMethod("OnTop", BindingFlags.Static | BindingFlags.NonPublic, null, new[] { typeof(bool), typeof(RectInt), typeof(RectInt?) }, null);
+ return (bool)method.Invoke(null, new object[] { stayOnTop, window, player });
+ }
+
+ [Test]
+ public void ADmdOverThePlayersWindowStaysOnTopWithoutTheSetting()
+ {
+ Assert.That(OnTop(false, new RectInt(700, 40, 512, 128), Player), Is.True, "over the playfield");
+ Assert.That(OnTop(false, new RectInt(1800, 1000, 512, 128), Player), Is.True, "partly over it");
+ }
+
+ private static DmdBridgeSettings ApplyComponent(DmdBridgeSettings previous, DmdBridgeSettings component, DmdBridgeSettings ini) => ApplyComponent(previous, component, ini, null, out _);
+
+ private static DmdBridgeSettings ApplyComponent(DmdBridgeSettings previous, DmdBridgeSettings component, DmdBridgeSettings ini, bool? stayOnTopOverride, out bool? overrideAfter)
+ {
+ var method = typeof(DmdBridgePlayer).GetMethod("ApplyComponentPresentation", BindingFlags.Static | BindingFlags.NonPublic);
+ overrideAfter = (bool?)method.Invoke(null, new object[] { previous, component, ini, stayOnTopOverride });
+ return ini;
+ }
+
+ [Test]
+ public void AnotherEditOnTheComponentKeepsTheIniStacking()
+ {
+ // the INI says stayontop, the component's field is still its default, and only the dot size was changed on it
+ var previous = new DmdBridgeSettings { NativeWindowStayOnTop = false, DotSize = 0.9f };
+ var component = new DmdBridgeSettings { NativeWindowStayOnTop = false, DotSize = 0.7f };
+ var settings = ApplyComponent(previous, component, new DmdBridgeSettings { NativeWindowStayOnTop = true, DotSize = 0.9f });
+ Assert.That(settings.NativeWindowStayOnTop, Is.True);
+ Assert.That(settings.DotSize, Is.EqualTo(0.7f));
+ }
+
+ [Test]
+ public void ChangingTheStackingOnTheComponentOverridesTheIni()
+ {
+ var previous = new DmdBridgeSettings { NativeWindowStayOnTop = false };
+ var component = new DmdBridgeSettings { NativeWindowStayOnTop = true };
+ Assert.That(ApplyComponent(previous, component, new DmdBridgeSettings { NativeWindowStayOnTop = false }).NativeWindowStayOnTop, Is.True);
+ }
+
+ [Test]
+ public void TheStackingChangedOnTheComponentHoldsThroughItsOtherEdits()
+ {
+ // the INI says no stayontop; it's turned on on the component, then only the dot size changes
+ var first = ApplyComponent(new DmdBridgeSettings { NativeWindowStayOnTop = false }, new DmdBridgeSettings { NativeWindowStayOnTop = true },
+ new DmdBridgeSettings { NativeWindowStayOnTop = false }, null, out var stayOnTop);
+ Assert.That(first.NativeWindowStayOnTop, Is.True);
+ Assert.That(stayOnTop, Is.True);
+
+ var second = ApplyComponent(new DmdBridgeSettings { NativeWindowStayOnTop = true, DotSize = 0.9f }, new DmdBridgeSettings { NativeWindowStayOnTop = true, DotSize = 0.7f },
+ new DmdBridgeSettings { NativeWindowStayOnTop = false, DotSize = 0.9f }, stayOnTop, out stayOnTop);
+ Assert.That(second.NativeWindowStayOnTop, Is.True);
+ Assert.That(second.DotSize, Is.EqualTo(0.7f));
+ Assert.That(stayOnTop, Is.True);
+ }
+
+ private static void Set(DmdBridgePlayer dmd, string field, object value)
+ => typeof(DmdBridgePlayer).GetField(field, BindingFlags.Instance | BindingFlags.NonPublic)!.SetValue(dmd, value);
+
+ // a check of the settings, as the bridge does them while it runs
+ private static DmdBridgeSettings Load(DmdBridgePlayer dmd)
+ {
+ var settings = (DmdBridgeSettings)typeof(DmdBridgePlayer).GetMethod("LoadSettings", BindingFlags.Instance | BindingFlags.NonPublic)!.Invoke(dmd, null);
+ Set(dmd, "_settings", settings);
+ return settings;
+ }
+
+ [Test]
+ public void AnIniEditedWithAnotherComponentChangeHasTheStacking()
+ {
+ // the INI says no stayontop, it's turned on on the component, then the INI is saved and the dot size changes
+ // on the component before the same check: the INI holds, as when it's saved alone
+ var ini = Path.Combine(Path.GetTempPath(), $"DmdDevice-{Guid.NewGuid():N}.ini");
+ var envConfig = Environment.GetEnvironmentVariable("DMDDEVICE_CONFIG");
+ var gameObject = new GameObject("DMD");
+ try {
+ // the user's DmdDevice.ini would go first
+ Environment.SetEnvironmentVariable("DMDDEVICE_CONFIG", null);
+ File.WriteAllText(ini, "[virtualdmd]\nstayontop = false\n");
+ var saved = DateTime.UtcNow.AddMinutes(-10);
+ File.SetLastWriteTimeUtc(ini, saved);
+ var dmd = gameObject.AddComponent();
+ Set(dmd, "_dmdDeviceIniPath", ini);
+ Set(dmd, "_dotSize", 0.9f);
+ Assert.That(Load(dmd).NativeWindowStayOnTop, Is.False, "the INI");
+
+ Set(dmd, "_nativeWindowStayOnTop", true);
+ Assert.That(Load(dmd).NativeWindowStayOnTop, Is.True, "turned on on the component");
+
+ Set(dmd, "_dotSize", 0.7f);
+ Assert.That(Load(dmd).NativeWindowStayOnTop, Is.True, "through another edit on the component");
+
+ File.SetLastWriteTimeUtc(ini, saved.AddMinutes(1));
+ Set(dmd, "_dotSize", 0.5f);
+ var settings = Load(dmd);
+ Assert.That(settings.NativeWindowStayOnTop, Is.False, "the INI saved since");
+ Assert.That(settings.DotSize, Is.EqualTo(0.5f), "the component's dot size");
+
+ } finally {
+ Environment.SetEnvironmentVariable("DMDDEVICE_CONFIG", envConfig);
+ Object.DestroyImmediate(gameObject);
+ File.Delete(ini);
+ }
+ }
+
+ [Test]
+ public void ADmdElsewhereKeepsTheSetting()
+ {
+ Assert.That(OnTop(false, new RectInt(1920, 0, 512, 128), Player), Is.False, "on the next monitor, edge to edge");
+ Assert.That(OnTop(true, new RectInt(1920, 0, 512, 128), Player), Is.True);
+ // no player window to go by: in the editor, minimized, or in exclusive fullscreen
+ Assert.That(OnTop(false, new RectInt(700, 40, 512, 128), null), Is.False);
+ Assert.That(OnTop(true, new RectInt(700, 40, 512, 128), null), Is.True);
+ }
+ }
+}
diff --git a/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs.meta b/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs.meta
new file mode 100644
index 0000000..b9962cc
--- /dev/null
+++ b/VisualPinball.Engine.DMD.Unity/Tests/NativeWindowStackingTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: f0764d2e8dcb5694a81a7fa737e100a8
\ No newline at end of file