Open dortamiguel opened 10 months ago
Have you tried with fullscreen desktop (SDL_WINDOW_FULLSCREEN_DESKTOP
) instead of exclusive fullscreen (SDL_WINDOW_FULLSCREEN
)?
@slime73 I just tried and I got no luck with it. Also I noticed something else,
If I use the maximize button to go fullscreen the menubar appears if I touch the top edge of the window
But if I use this SDL function then the fullscreen will lock the mouse cursor and the menubar won't appear when moving the cursor to the top
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
might be possible that SDL is handling fullscreen differently than what macos expects these days?
@dortamiguel - Is your app by chance a plain executable or bundled as an .app
?
I "think" I'm noticing with a plain executable, the mode doesn't kick in.
When bundling as an app, I see the notification, but if I use SDL_WINDOW_FULLSCREEN_DESKTOP
or SDL_WINDOW_FULLSCREEN
I don't see it unless I quickly close the game. It's almost like the notification is behind the full screen window.
@jsm174 yes I just bundle the plain executable inside an .app
In my case it doesn't matter if I use SDL_WINDOW_FULLSCREEN
, usually if I go back to the desktop and the game is still running I see in the menubar a controller icon that tells gamemode is enabled, but with my game I just don't see it.
It might be possible that the problem is that my info.plist is incomplete or my app is not signed?
Okay, we spent some time on this, and I think you need to add:
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
to your Info.plist
That seems to work for our app:
@jsm174 do you make anything else like signing the executable?
Currently right now I'm not signing the app, and it's definitely getting activated.
can I see your complete info.plist?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>org.vpinball.VPinballX_GL</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>VPinballX_GL</string>
<key>CFBundleExecutable</key>
<string>VPinballX_GL</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>vpx</string>
</array>
<key>CFBundleTypeName</key>
<string>Visual Pinball X Table</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleGetInfoString</key>
<string>VPinballX_GL 10.8.0</string>
<key>CFBundleIconFile</key>
<string>VPinballX_GL.icns</string>
<key>CFBundleName</key>
<string>VPinballX_GL</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>ESDE</string>
<key>CFBundleShortVersionString</key>
<string>2.2.1</string>
<key>CFBundleVersion</key>
<string>2.2.1</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>10.15.0</string>
<key>LSUIPresentationMode</key>
<integer>3</integer>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSMainNibFile</key>
<string>VPinballX_GL</string>
<key>NSHumanReadableCopyright</key>
<string></string>
</dict>
</plist>
@jsm174 thank you! I had no luck, somehow is not working
So did we decide this isn't an SDL bug, or is this still an open question?
This is still an open question.
Game mode in maximized-fullscreen and desktop-fullscreen is working fine for my stuff for what it's worth, with SDL2 and SDL3 and with OpenGL and Metal. I haven't tried with SDL_Render though.
My app is a normal packaged .app, without any LSApplicationCategoryType key in its info.plist (nevermind, it does have that - it's just had it for such a long time that I didn't remember it's there. But removing it doesn't prevent game mode from working, for me).
edit: If you're using MoltenVK, I wonder if that's preventing it from activating if it's doing something weird with Metal device selection under the hood?
@slime73 I'm using MoltenVK but if I switch to OpenGL I get the same result, if you run the test/testsprite
from SDL do you get the Game Mode?
I'm using SDL3, maybe the issue is there?
With testsprite, I just had to set the app category to Games in its info plist, and then clean and rebuild. I guess the reason why it continued working when I removed the Games category from my own app is I didn't do the clean step.
So I think this issue is resolved now.
@slime73 Could you upload an app with testsprite? I just tried but is still not working for me, I cleaned my cache too and copied your info.plist but I can't make it work. If I open other games from steam I get the notification for game mode so it seems like is working, I just can't make it work on my game somehow.
There is a new Game Mode in Sonoma that priorizes game performance when the application starts in fullscreen. https://support.apple.com/en-asia/HT213658
I tried with a few games and it seems to toggle when I start them, but somehow I can't get it on my own one when using SDL.
This is basically how I create my window
Is there anything else I should do to enable this?