Skip to content

Add support for SDL3 fullscreen events #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2025

Conversation

kiddkaffeine
Copy link
Contributor

@kiddkaffeine kiddkaffeine commented May 5, 2025

Appears to address the issue mentioned in #524 on macOS.

Copy link
Member

@flibitijibibo flibitijibibo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to reproduce this with Wayland which has a similar user-facing option and couldn't make it happen, so aside from this tedious spec-lawyer fix this lgtm

Comment on lines 1039 to 1047
if (manager is GraphicsDeviceManager)
{
((GraphicsDeviceManager) manager).IsFullScreen = true;
}
}
else if (evt.type == (uint) SDL.SDL_EventType.SDL_EVENT_WINDOW_LEAVE_FULLSCREEN)
{
Object manager = game.Services.GetService(typeof(IGraphicsDeviceManager));
if (manager is GraphicsDeviceManager)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of weird timing issues:

Suggested change
if (manager is GraphicsDeviceManager)
{
((GraphicsDeviceManager) manager).IsFullScreen = true;
}
}
else if (evt.type == (uint) SDL.SDL_EventType.SDL_EVENT_WINDOW_LEAVE_FULLSCREEN)
{
Object manager = game.Services.GetService(typeof(IGraphicsDeviceManager));
if (manager is GraphicsDeviceManager)
if (manager != null && manager is GraphicsDeviceManager)
{
((GraphicsDeviceManager) manager).IsFullScreen = true;
}
}
else if (evt.type == (uint) SDL.SDL_EventType.SDL_EVENT_WINDOW_LEAVE_FULLSCREEN)
{
Object manager = game.Services.GetService(typeof(IGraphicsDeviceManager));
if (manager != null && manager is GraphicsDeviceManager)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null check added

@flibitijibibo flibitijibibo merged commit d653de5 into FNA-XNA:master May 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants