MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


MAME opengl/bgfx/gdi and 'alt-tab'
#368993 - 08/24/17 05:24 PM


Hi,

I'm not sure if this is the right place to bring this up, and it's really just a minor issue, but:

On my Windows 10 Home 64-bit system running official MAME v0.187 64-bit, I am experiencing some odd behavior when running '-video opengl' (or bgfx/gdi) and using the Windows 'alt-tab' keys to switch to other windows.

When I run : mame64 pacman -video d3d

I can alt-tab to other windows as expected.

But when I run: 'mame64 pacman -video opengl' (or bgfx/gdi)

'alt-tab' keeps the focus on the MAME window, without switching to the other windows. I have not experienced this behavior with the other (very few, admittedly) opengl applications I have installed on this system.

In case it matters, I have a NVIDIA GeForce GTX 760 (ASUS GTX 760 DirectCU II OC) video adapter, and an Asus ROG Swift PG278Q display (2560 X 1440 @ 144 Hertz), and am running MAME full-screen.

I was wondering if anyone could reproduce this, or if it is just expected behavior, or if there is something going on with my specific setup ?



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4453
Loc: Melbourne, Australia
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#368995 - 08/24/17 06:09 PM


If you use Alt+Enter to toggle windowed mode, can you then use Alt+Tab to switch applications? I can't remember what Windows is supposed to do, but that's the behaviour on OSX (need to use Option-Return to get out of fullscreen before Cmd-Tab will work). MAME could be doing system shortcut capture in full screen.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Vas Crabb]
#368997 - 08/24/17 06:29 PM


> If you use Alt+Enter to toggle windowed mode, can you then use Alt+Tab to switch
> applications?

Yes, if I switch to windowed-mode with alt-enter, I can then switch between windows with alt-tab even when running '-video opengl/bgfx/gdi'.


> I can't remember what Windows is supposed to do, but that's the
> behaviour on OSX (need to use Option-Return to get out of fullscreen before Cmd-Tab
> will work).

As far as my personal experience goes, 'alt-tab' on Windows works always, even when running applications full-screen.


> MAME could be doing system shortcut capture in full screen.

Perhaps. But that doesn't explain why alt-tab when using '-video d3d' and running full-screen works as expected (does switch between windows).

Edited by mhoes (08/24/17 06:35 PM)



RobbbertModerator
Sir
Reged: 08/21/04
Posts: 3180
Loc: A long way from you
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Vas Crabb]
#368998 - 08/24/17 07:30 PM


>



BIOS-D
MAME Fan
Reged: 08/07/06
Posts: 1686
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#368999 - 08/24/17 07:57 PM


> Perhaps. But that doesn't explain why alt-tab when using '-video d3d' and running
> full-screen works as expected (does switch between windows).

It's possible the front-end you are using, the card driver, any other program, an unfocused dialog box or the build itself you're using is generating a hidden window under those modes. When that usually happens pressing Alt twice fixes the problem (Hold Alt -> Press Tab twice -> Release Alt). Try three times if necessary and tell us what happens.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: BIOS-D]
#369000 - 08/24/17 08:03 PM


> It's possible the front-end you are using,

I'm not using a 'front-end', it's the basic official mame from mamedev for Windows.


> pressing Alt twice fixes the problem (Hold Alt -> Press Tab twice -> Release Alt).

Pressing the buttons multiple times (Hold Alt -> Press Tab twice/three/four/five/six-times -> Release Alt) does not change things.



Envisaged0ne
MAME Fan
Reged: 08/29/06
Posts: 543
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369001 - 08/24/17 08:51 PM


Yeap, I can confirm this happens with me also. I'm running MAME 0.188. Not using any front-ends. When I try using OpenGL, I can't switch to other windows when using Alt+Tab. It just keeps the focus on the game. However, you can use Alt+Enter to switch it to a window, then use Alt+Tab to switch to different applications

Edited by Envisaged0ne (08/24/17 08:52 PM)



Windows 11 64 bit OS
Intel Core i7-10700
Nvidia GeForce RTX 2060 6GB
32GB DDR4 RAM



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Robbbert]
#369002 - 08/24/17 08:54 PM


> > If you use Alt+Enter to toggle windowed mode, can you then use Alt+Tab to switch
> > applications? I can't remember what Windows is supposed to do, but that's the
> > behaviour on OSX (need to use Option-Return to get out of fullscreen before Cmd-Tab
> > will work). MAME could be doing system shortcut capture in full screen.
>
> Windows will always Alt-Tab, full screen or not is irrelevant.

Well this is what I always suspected (and confirmed in my specific usage) to begin with (but didn't care enough about to research it, so personally couldn't verify), but am sure glad to have seen confirmed.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Envisaged0ne]
#369003 - 08/24/17 08:57 PM


> Yeap, I can confirm this happens with me also. I'm running MAME 0.188. Not using any
> front-ends. When I try using OpenGL, I can't switch to other windows when using
> Alt+Tab. It just keeps the focus on the game. However, you can use Alt+Enter to
> switch it to a window, then use Alt+Tab to switch to different applications

Thank you so much for confirming this. I thought I was losing my mind here

So... Should I open a bug for this over on mametesters (or whatever the 'official' bug report place is these days for mame) ?

Edited by mhoes (08/24/17 08:58 PM)



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4453
Loc: Melbourne, Australia
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369009 - 08/25/17 12:29 AM


> > MAME could be doing system shortcut capture in full screen.
>
> Perhaps. But that doesn't explain why alt-tab when using '-video d3d' and running
> full-screen works as expected (does switch between windows).

Because the D3D video module doesn't do system shortcut capture while the others do? Different code runs for D3D obviously.



RobbbertModerator
Sir
Reged: 08/21/04
Posts: 3180
Loc: A long way from you
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369011 - 08/25/17 02:14 AM


>



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Vas Crabb]
#369022 - 08/25/17 09:18 AM


> > > MAME could be doing system shortcut capture in full screen.
> >
> > Perhaps. But that doesn't explain why alt-tab when using '-video d3d' and running
> > full-screen works as expected (does switch between windows).
>
> Because the D3D video module doesn't do system shortcut capture while the others do?
> Different code runs for D3D obviously.

Well perhaps I'm just an idiot. Yes, I get that it's obviously different code for different methods of displaying things on the screen. Opengl, D3D, etc. have different API's. But what I don't get is why a 'video module' would be doing 'system shortcut capture' at all ? I mean, isn't 'system shortcut capture' a different part of the code than the 'video modules' ?



Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4453
Loc: Melbourne, Australia
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369023 - 08/25/17 09:39 AM


> Well perhaps I'm just an idiot. Yes, I get that it's obviously different code for
> different methods of displaying things on the screen. Opengl, D3D, etc. have
> different API's. But what I don't get is why a 'video module' would be doing 'system
> shortcut capture' at all ? I mean, isn't 'system shortcut capture' a different part
> of the code than the 'video modules' ?

The video module creates a window, video context etc. and they can work quite differently. As an example of different behaviour, bgfx uses a borderless window for full screen mode while d3d uses full screen exclusive mode. Depending on how exactly the window is set up, different events could be captured by the application.



-Mitaine-
SEGA Junkie
Reged: 10/27/13
Posts: 23
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Robbbert]
#369024 - 08/25/17 09:41 AM


In my (admittedly outdated) experience, alt-tabbing out of fullscreen OpenGL apps has always been a bit fucky. It may be more related to video drivers than anything.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: -Mitaine-]
#369025 - 08/25/17 09:48 AM


> In my (admittedly outdated) experience, alt-tabbing out of fullscreen OpenGL apps has
> always been a bit fucky. It may be more related to video drivers than anything.

Well practically the only OpenGL game I have currently installed is the DOOM (2016) [demo], and with that I can alt-tab to other windows. The funky part here for me is that DOOM also switches the screen resolution while it is running, and so alt-tabbing to other windows messes things up because the resolution is still changed. It sets it back to the original resolution when you exit the game though.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Robbbert]
#369026 - 08/25/17 09:50 AM


> > Thank you so much for confirming this. I thought I was losing my mind here
> >
> > So... Should I open a bug for this over on mametesters (or whatever the 'official'
> > bug report place is these days for mame) ?
>
> Yes.

Will do. I signed up, and am currently awaiting approval.



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369027 - 08/25/17 11:38 AM


Well, i do remember that Jezze did fix this bug, but only for d3d. Why he did it only for d3d, are reasons i dont want to explain here in detail. It was expected that someone transfer HLSL to BGFX and so Jezze never touched the BGFX part.

While excessive HLSL testing, Jezze and me found that bug (that existed even for d3d mode) two years ago and we reported that.
It was said, that Jezze created that bug, by his overhaul changes in MAME 0.160 (could be 0.161 or 0.162, cant remember it exactly), which of course was not true, but he fixed it.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: uman]
#369032 - 08/25/17 01:04 PM


> Well, i do remember that Jezze did fix this bug, but only for d3d. Why he did it only
> for d3d, are reasons i dont want to explain here in detail. It was expected that
> someone transfer HLSL to BGFX and so Jezze never touched the BGFX part.
>
> While excessive HLSL testing, Jezze and me found that bug (that existed even for d3d
> mode) two years ago and we reported that.
> It was said, that Jezze created that bug, by his overhaul changes in MAME 0.160
> (could be 0.161 or 0.162, cant remember it exactly), which of course was not true,
> but he fixed it.

Ah. Thanks for pointing that out. So apparently, I found a 'known issue'. Hurray for me.

Anyway, I did a quick search over on mametesters for all issues reported by uman/Jezze, and a separate search for a few variations of the string 'alt-tab', but did not find this bug. So unless my query's were wrong, currently there is no reported issue for this on mametesters. When/if my account gets approved, I'll report it there.



uman
MAME Fan
Reged: 04/15/12
Posts: 455
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369035 - 08/25/17 02:21 PM


That is because we did not report it there, in fact the report was a shout-box discussion on forums.bannister.org

I mean Jezze was a MAME contributor, so no need for him to report it on MAME testers.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: uman]
#369036 - 08/25/17 02:31 PM


> That is because we did not report it there, in fact the report was a shout-box
> discussion on forums.bannister.org
>
> I mean Jezze was a MAME contributor, so no need for him to report it on MAME testers.

Point taken.

Still, it seems to me that it might be good idea to at least document it (semi-)permanently 'somewhere' (might as well be mametesters). Right ?



Calamity
MAME Fan
Reged: 05/30/11
Posts: 56
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: Vas Crabb]
#369077 - 08/28/17 01:39 AM


GroovyMAME has a workaround for this issue, although it's a bit of compromise. Upon an alt-tab or windows key press while in full screen mode, it automatically sets windowed mode. After that, once you alt-tab back to GroovyMAME, in order to return to full screen mode you need to manually press alt+enter. This trick allows consistent behaviour across all renderers. I had to make this when support for bgfx was added.



mhoes
MAME Fan
Reged: 08/27/15
Posts: 161
Send PM


Re: MAME opengl/bgfx/gdi and 'alt-tab' new [Re: mhoes]
#369099 - 08/28/17 10:04 AM


I submitted the following bug report for this on MAME Testers :

http://mametesters.org/view.php?id=6670


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 19 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1793