Disable alt-enter fullscreen?

2,017 views
Skip to first unread message

Mark Sibly

unread,
Jun 8, 2016, 2:00:53 AM6/8/16
to angleproject
Hi,

I guess it's a d3d thing, but when I hit Alt-Enter in my SDL+angle app it tries to go fullscreen.

This 'sort of' works, but after a mode switch my 640x480 window just ends up in the top left of the desktop. I also can't interact with it at all, key events are ignored etc.

But I don't want to allow this anyway - is there a way to disable Alt-Enter via angle, or do I have to get messy with windows?

Bye!
Mark

Mark Sibly

unread,
Jun 8, 2016, 2:44:57 AM6/8/16
to angleproject
Ok, quick solution - add this after CreateSwapChain() succeeds in SwapChain11.cpp...

mRenderer->getDxgiFactory()->MakeWindowAssociation((HWND)mNativeWindow->getNativeWindow(),DXGI_MWA_NO_WINDOW_CHANGES );

...as per...

Jamie Madill

unread,
Jun 8, 2016, 6:41:51 PM6/8/16
to Mark Sibly, angleproject
I feel like this should ultimately be something managed by SDL, not ANGLE. But if you've found a solution that works for you, good enough!

--
You received this message because you are subscribed to the Google Groups "angleproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angleproject...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jamie Madill

unread,
Jun 8, 2016, 7:04:43 PM6/8/16
to Mark Sibly, angleproject
+angleproject

I personally haven't used SDL with ANGLE, or know people who have, so there may be bugs in either end preventing seamless resizing.

I can answer your second question. ANGLE exposes an EGL extension which allows you to query the D3D device directly.


For example usage you can see EGLDeviceTest.cpp, but it's not too hard to figure out.

On Wed, Jun 8, 2016 at 3:59 PM, Mark Sibly <blitz...@gmail.com> wrote:
> I feel like this should ultimately be something managed by SDL, not ANGLE

I would have preferred to do this, but how do I get at the necessary d3d crap from the SDL side? As far as SDL's concerned, it's just an EGL context.It also sounds like it's senstive to when it's called, ie: just after SwapChain creation.

Also, I'm not sure angle is handling it properly either - there doesn't appear to be any resizing happening at all, the window just gets moved to the top left. Screen resolution doesn't appear to change or anything, but that could just be d3d doing fake fullscreen.

Has anyone else successfully used this 'feature'?

Another option would be an EGL_blah style extension I guess.

James Ross-Gowan

unread,
Jun 14, 2016, 2:56:57 AM6/14/16
to angleproject
We also had this problem in mpv. It should affect every program that uses D3D11/ANGLE, renders to a top-level window and doesn't use DirectComposition, because DXGI will hook the window and override the Alt+Enter keystroke.

We fixed it in mpv with the following commit, but I think it would make more sense to fix it upstream in ANGLE:
https://github.com/mpv-player/mpv/commit/a9150a4

Jamie Madill

unread,
Jun 14, 2016, 11:27:37 AM6/14/16
to rossy...@gmail.com, angleproject
We should indeed fix it upstream if it affects this many users. Maybe one of you could upload a proposed fix to ANGLE? Barring that, opening an issue on our tracker would push us to fix it when we have time.

--

James Ross-Gowan

unread,
Jun 15, 2016, 7:45:25 AM6/15/16
to angleproject, rossy...@gmail.com
Sounds good. I'll work on a patch. It should be pretty simple (just those MakeWindowAssociation calls.)

Jamie Madill

unread,
Jun 15, 2016, 8:57:28 AM6/15/16
to rossy...@gmail.com, angleproject
Reply all
Reply to author
Forward
0 new messages