Jump to content
LaunchBox Community Forums

Steam games won't load in front of big box after running a mame game


Recommended Posts

Hey all, I think I've tried erything I can think of, but I'm still having this issue.

 

When I'm in Big Box and switch from launching a MAME game to a Steam game, like Street Fighter 6, the game window remains behind Big Box.

 

I've made sure to disable all custom apps and scripts. Additionally, I created a Steam shortcut that launches on boot in silent mode. I've also tried removing silent mode and disabling Steam from boot altogether, but none of these options resolve the issue.

 

Interestingly, when I switch from emulators such as RetroArch or Model 3, this problem doesn't occur.

 

The only way I can tell if the game is running is if I press Alt+Tab. Big Box seems essentially stuck unless I Alt+Tab to the game and press Alt+F4. Even during this process, the game remains behind Big Box.

 

I'm using Windows 11 and the latest version of Launchbox as of May 29, 2024. This issue happens 100% of the time.

 

Appreciate any advice

Link to comment
Share on other sites

  • 3 weeks later...

I have the same issue. Did you ever fix it or work out what was wrong?

Even when you use Alt+Tab the window still stays behind BigBox, the only difference is the BigBox screen effectively pauses and the audio switches from BigBox to the game audio.

Controls work for the game too. There just seems to be nothing you can do to bring the active window to the front.

I don't think it's tied to the start-up screen as I've tried everything with that and switched it off entirely and it still doesn't help.

I hadn't realised it was only when switching from MAME. I'll give that a check to see if it's the same for me. Most of my go-to games are MAME so it's entirely likely I just hadn't noticed. 

I'd got into the habit of restarting my machine when I want to play Steam as it seemed to be the only way it would work 100% of the time.

Edited by Frankie_Sambuca
Link to comment
Share on other sites

Posted (edited)
14 hours ago, Frankie_Sambuca said:

I have the same issue. Did you ever fix it or work out what was wrong?

Even when you use Alt+Tab the window still stays behind BigBox, the only difference is the BigBox screen effectively pauses and the audio switches from BigBox to the game audio.

Controls work for the game too. There just seems to be nothing you can do to bring the active window to the front.

I don't think it's tied to the start-up screen as I've tried everything with that and switched it off entirely and it still doesn't help.

I hadn't realised it was only when switching from MAME. I'll give that a check to see if it's the same for me. Most of my go-to games are MAME so it's entirely likely I just hadn't noticed. 

I'd got into the habit of restarting my machine when I want to play Steam as it seemed to be the only way it would work 100% of the time.

I havent resolved but im pretty sure i pinpointed the issue.

I've identified that this seems to happen to games that are not using Fullscreen (Borderless window is not recognized as exclusive full screen.) While looking deeper, it seems to impact DX12 games in particular which makes sense as DX12 does not support (exclusive) full screen,

I reached out to, support@unbrokensoftware.com and they said they couldn't reproduce and ignored all my additional responses. Perhaps you can reach out to show another instance?

Here is their response.

Quote

 

So, I reviewed your Data files, and outside of some custom AHK scripts for MAME, I didn't see anything out of the ordinary. I then loaded in your Data files and ran some tests launching games in a similar way as you do. Interestingly enough, I'm not seeing any issues that you are seeing.
 
What this seems to indicate is that whatever is going on with your build, most likely will be found outside of LaunchBox. Maybe a specific MAME configuration, or a Steam configuration that I don't have on my side here.
 
One thing you could try and do is run a utility like Jocys.com Focus Logger, which can provide you with a history of every program/process that tries to grab focus. Run the program when going through the motions and it's possible it might point you to some interesting findings.
 
Also, if you haven't already, see if removing the Steam shortcut from your Startup Applications changes anything for you. Not sure why that would affect anything, but worth a shot.

 

I tried all the steps they recommended, i did these steps before reaching out initially but i guess they didn't read my full report. 

Hope this helps, the more reports they get the more likely they will fix it.

Edited by kingkoopa505
Link to comment
Share on other sites

@kingkoopa505 @Frankie_Sambuca

I've recently heard of a couple others having similar issues (not the exact same, but related to 'window focus' issues and 'MAME').

The fix for both of them in their case was to edit the MAME emulator (in LaunchBox) and on the main Details page, un-check the box Attempt to hide console window on startup/shutdown.

This relates to the comment "this seems to happen to games that are not using Fullscreen (Borderless window is not recognized as exclusive full screen.)"

 

Again, I'm not saying this is "the fix" for your situation(s).  But something worth trying.

Link to comment
Share on other sites

8 hours ago, JoeViking245 said:

@kingkoopa505 @Frankie_Sambuca

I've recently heard of a couple others having similar issues (not the exact same, but related to 'window focus' issues and 'MAME').

The fix for both of them in their case was to edit the MAME emulator (in LaunchBox) and on the main Details page, un-check the box Attempt to hide console window on startup/shutdown.

This relates to the comment "this seems to happen to games that are not using Fullscreen (Borderless window is not recognized as exclusive full screen.)"

 

Again, I'm not saying this is "the fix" for your situation(s).  But something worth trying.

That doesn't work. I still get the problem

Link to comment
Share on other sites

I have also been having the same issue after exiting MAME games and finally decided to look into it. @kim_sama98 @kingkoopa505 @Frankie_Sambuca Please try dropping the attached file into your LaunchBox/Plugins folder and restart BigBox. This fixed it for me (can't promise it will fix it for you).

Edit: There's a chance this workaround might not work when running as non-admin (I haven't tried it). So if it doesn't work at first, try right-clicking on BigBox and selecting "Run as Administrator" before giving up.

 

@C-Beats If any of the devs want to look into this, the issue I was seeing is that sometimes after exiting a MAME game, the BigBox window's topmost flag is set and remains set. I won't guess why that is happening, but I did verify it with GetWindowLong(hWnd, GWL_EXSTYLE). All the plugin is doing as a workaround is checking for this condition and clearing topmost with SetWindowPos(hWnd, HWND_NOTOPMOST, ...) when needed. 

TempBigBoxTopmostCleanup.dll

Edited by superrob3000
Link to comment
Share on other sites

28 minutes ago, superrob3000 said:

I have also been having the same issue after exiting MAME games and finally decided to look into it. @kim_sama98 @kingkoopa505 @Frankie_Sambuca Please try dropping the attached file into your LaunchBox/Plugins folder and restart BigBox. This fixed it for me (can't promise it will fix it for you).

 

@C-Beats If any of the devs want to look into this, the issue I was seeing is that sometimes after exiting a MAME game, the BigBox window's topmost flag is set and remains set. I won't guess why that is happening, but I did verify it with GetWindowLong(hWnd, GWL_EXSTYLE). All the plugin is doing as a workaround is checking for this condition and clearing topmost with SetWindowPos(hWnd, HWND_NOTOPMOST, ...) when needed. 

TempBigBoxTopmostCleanup.dll 67.5 kB · 0 downloads

Thanks, you're hero. Saved me time.

Link to comment
Share on other sites

Posted (edited)
On 6/17/2024 at 6:23 AM, superrob3000 said:

I have also been having the same issue after exiting MAME games and finally decided to look into it. @kim_sama98 @kingkoopa505 @Frankie_Sambuca Please try dropping the attached file into your LaunchBox/Plugins folder and restart BigBox. This fixed it for me (can't promise it will fix it for you).

Edit: There's a chance this workaround might not work when running as non-admin (I haven't tried it). So if it doesn't work at first, try right-clicking on BigBox and selecting "Run as Administrator" before giving up.

 

@C-Beats If any of the devs want to look into this, the issue I was seeing is that sometimes after exiting a MAME game, the BigBox window's topmost flag is set and remains set. I won't guess why that is happening, but I did verify it with GetWindowLong(hWnd, GWL_EXSTYLE). All the plugin is doing as a workaround is checking for this condition and clearing topmost with SetWindowPos(hWnd, HWND_NOTOPMOST, ...) when needed. 

TempBigBoxTopmostCleanup.dll 67.5 kB · 5 downloads

@superrob3000

hero level community contribution. Thank you, worked for me as well and I'm not running as admin. 

Edited by kingkoopa505
Link to comment
Share on other sites

On 6/17/2024 at 8:23 AM, superrob3000 said:

I have also been having the same issue after exiting MAME games and finally decided to look into it. @kim_sama98 @kingkoopa505 @Frankie_Sambuca Please try dropping the attached file into your LaunchBox/Plugins folder and restart BigBox. This fixed it for me (can't promise it will fix it for you).

Edit: There's a chance this workaround might not work when running as non-admin (I haven't tried it). So if it doesn't work at first, try right-clicking on BigBox and selecting "Run as Administrator" before giving up.

 

@C-Beats If any of the devs want to look into this, the issue I was seeing is that sometimes after exiting a MAME game, the BigBox window's topmost flag is set and remains set. I won't guess why that is happening, but I did verify it with GetWindowLong(hWnd, GWL_EXSTYLE). All the plugin is doing as a workaround is checking for this condition and clearing topmost with SetWindowPos(hWnd, HWND_NOTOPMOST, ...) when needed. 

TempBigBoxTopmostCleanup.dll 67.5 kB · 5 downloads

Looked in the codebase and we do use something similar to this in the startup/pause windows, but not Big Box. Is it possible that another plugin is setting that flag incorrectly on the main application window? I know we have several plugins in the community that do various things regarding where/how the application windows are displayed. I'll keep looking but right now coming up dry unfortunately.

Link to comment
Share on other sites

4 minutes ago, C-Beats said:

Looked in the codebase and we do use something similar to this in the startup/pause windows, but not Big Box. Is it possible that another plugin is setting that flag incorrectly on the main application window? I know we have several plugins in the community that do various things regarding where/how the application windows are displayed. I'll keep looking but right now coming up dry unfortunately.

I cannot speak on behalf of the others, but I don't have any other plugins set up. This fix is the first one I've utilized.

Link to comment
Share on other sites

1 hour ago, C-Beats said:

Looked in the codebase and we do use something similar to this in the startup/pause windows, but not Big Box. Is it possible that another plugin is setting that flag incorrectly on the main application window? I know we have several plugins in the community that do various things regarding where/how the application windows are displayed. I'll keep looking but right now coming up dry unfortunately.

@C-Beats Thank you for looking. The issue is definitely present without any plugins (deleting all plugins was the first thing I tried just to make sure I hadn't caused the issue myself). 

Link to comment
Share on other sites

@C-Beats Also I just did a test and it doesn't happen if I disable startup/end screens for MAME under Manage->Emulators. So if topmost is being altered for startup/end screens it seems like it's ending up getting applied to the main window and sometimes not getting cleared. For me it's not 100% of the time but it's up around 90%. Hope that helps...

 

Here's the source for the workaround in case it might give you any clues (it's just a few lines): https://github.com/superrob3000/TempBigBoxTopmostCleanup/blob/master/TempBigBoxTopmostCleanup/App_SystemEvents.cs

Edited by superrob3000
Link to comment
Share on other sites

48 minutes ago, superrob3000 said:

@C-Beats Also I just did a test and it doesn't happen if I disable startup/end screens for MAME under Manage->Emulators. So if topmost is being altered for startup/end screens it seems like it's ending up getting applied to the main window and sometimes not getting cleared. For me it's not 100% of the time but it's up around 90%. Hope that helps...

 

Here's the source for the workaround in case it might give you any clues (it's just a few lines): https://github.com/superrob3000/TempBigBoxTopmostCleanup/blob/master/TempBigBoxTopmostCleanup/App_SystemEvents.cs

Thanks for this, I understood what you meant from your initial post. @faeran is now able to produce on his end, but still unable to really see in the code why this would even happen. If we can't work through why we may have to put something like this in place. Really hate just covering up the problem with code like that though. Prefer to take care of the root cause itself. I'll do my best to remember to update this thread when any changes make it's way into a beta.

Link to comment
Share on other sites

Just now, kingkoopa505 said:

Fantastic! Glad we were able to work this out!

Can let @superrob3000 take the credit for this victory. There is some logic in the startup screen that places our window in front of the window we just launched. Sometimes MAME windows have their window flags set to be "topmost" and when you swap your window to be in front of a "topmost" window YOUR window becomes top most in order for the OS to accurately place it in front. This was happening to our main view and since we weren't really planning for it we never checked the flag and cleared it. We removed the logic that needlessly moved the primary window (since startup window is still being moved to top anyway) and it should correct the issue.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...