diff --git a/src/FNAPlatform/SDL2_FNAPlatform.cs b/src/FNAPlatform/SDL2_FNAPlatform.cs index dffa3d2d..623610b2 100644 --- a/src/FNAPlatform/SDL2_FNAPlatform.cs +++ b/src/FNAPlatform/SDL2_FNAPlatform.cs @@ -1196,9 +1196,8 @@ ref bool textInputSuppress } else { - // Just reset, this is probably a hotplug - game.GraphicsDevice.Reset( - game.GraphicsDevice.PresentationParameters, + // Quietly update, this is probably a hotplug + game.GraphicsDevice.QuietlyUpdateAdapter( currentAdapter ); } diff --git a/src/FNAPlatform/SDL3_FNAPlatform.cs b/src/FNAPlatform/SDL3_FNAPlatform.cs index 57ca3625..1863d52b 100644 --- a/src/FNAPlatform/SDL3_FNAPlatform.cs +++ b/src/FNAPlatform/SDL3_FNAPlatform.cs @@ -1084,9 +1084,8 @@ ref bool textInputSuppress } else { - // Just reset, this is probably a hotplug - game.GraphicsDevice.Reset( - game.GraphicsDevice.PresentationParameters, + // Quietly update, this is probably a hotplug + game.GraphicsDevice.QuietlyUpdateAdapter( currentAdapter ); } diff --git a/src/Graphics/GraphicsDevice.cs b/src/Graphics/GraphicsDevice.cs index dcb44ddb..40de22bb 100644 --- a/src/Graphics/GraphicsDevice.cs +++ b/src/Graphics/GraphicsDevice.cs @@ -582,6 +582,26 @@ internal void RemoveResourceReference(GCHandle resourceReference) #endregion + #region Internal Adapter Updates + + /* This exists because display hotplugging is fragile and can + * cause problems if we try to do a hard Reset(). Even after + * refreshing the static Adapters list you find weird cases + * where a reset on an unrelated display will insist on a 0x0 + * window size??? :psyduck: + * + * So instead, just quietly swap the Adapter so that the device + * state is valid, and avoid messing with the window further. + * -flibit + */ + + internal void QuietlyUpdateAdapter(GraphicsAdapter adapter) + { + Adapter = adapter; + } + + #endregion + #region Public Present Method public void Present()