# GLFW disable restoring resolution of fullscreen window?

**URL:** <https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230>\
**Category:** support\
**Created:** [December 13, 2018, 4:24pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230 "2018-12-13T16:24:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![haubna](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@haubna](https://discourse.glfw.org/u/haubna)\
**Post date:** [December 13, 2018, 4:24pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/1 "2018-12-13T16:24:53Z")

</div>

Is it possible to disable restoring the previous video mode when the fullscreen window loses focus? I’ve noticed that Fortnite does this and I find it very nice. So basically when the user sets the application to 1280x720 (the monitor has a native resolution of 1920x1080) and the window loses focus the resolution of this monitor should stay on 1280x720 until the applications gets terminated.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 13, 2018, 5:21pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/2 "2018-12-13T17:21:48Z")

</div>

I think [GLFW\_AUTO\_ICONIFY](https://www.glfw.org/docs/latest/window.html#window_hints_wnd) might be what you are looking for.

---

<div class="post-metadata">

**Author:** ![haubna](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@haubna](https://discourse.glfw.org/u/haubna)\
**Post date:** [December 13, 2018, 5:29pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/3 "2018-12-13T17:29:49Z")

</div>

Thanks for the quick answer but sadly this restores the desktop resolution after tabbing (with alt+tab) out of the fullscreen application. I mean it says “restore the previous video mode” but when I disable it, it still restores the previous video mode.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 13, 2018, 6:58pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/4 "2018-12-13T18:58:38Z")

</div>

Could you clarify whether you have two monitors or are ALT-TABBING to an application on the same monitor? If the later GLFW\_AUTO\_ICONIFY won’t help (as you need to iconify the app in this case), and GLFW doesn’t have a hint for controlling this behaviour as it’s ‘best practice’ to reset the resolution once the window is iconified.

---

<div class="post-metadata">

**Author:** ![haubna](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@haubna](https://discourse.glfw.org/u/haubna)\
**Post date:** [December 13, 2018, 10:07pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/5 "2018-12-13T22:07:07Z")

</div>

I have two monitors. The behaviour that I want is that if I have a Desktop resolution of 1920x1080 and I start my application fullscreen with 1280x720 is that I want my changed Desktop resolution to stay at 1280x720 if I ALT-TAB or unfocus the window.

Image example: [http://puu.sh/ChcLO/b6ddbefb2e.png](http://puu.sh/ChcLO/b6ddbefb2e.png)  
Left: 1920x1080  
Right: 1280x720

The game changes my Desktop resolution and when I ALT-TAB it gives me a smooth experience because it doesn’t change back to my native Desktop resolution (it stays at 1280x720).

The smooth ALT-TAB experience can only be achieved in GLFW when applying the native resolution. I guess there is no way right now to make this happen right?

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 14, 2018, 5:42pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/6 "2018-12-14T17:42:16Z")

</div>

In my own tests (Windows 10 latest GLFW) setting

```auto
    glfwWindowHint(GLFW_AUTO_ICONIFY , GLFW_FALSE);

```

means that ALT+TAB will not cause a fullscreen window to iconify, so it will remain fullscreen at the chosen resolution. Note that this means you can’t ALT+TAB to a window on the same monitor, as it will be hidden under the fullscreen window.

Can I double check with you that you’ve used this setting?

---

<div class="post-metadata">

**Author:** ![haubna](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@haubna](https://discourse.glfw.org/u/haubna)\
**Post date:** [December 15, 2018, 10:07pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/7 "2018-12-15T22:07:54Z")

</div>

Ok apparently there is some kind of bug with my 240 Hz monitor. It works fine on my secondary monitor (60 Hz) on a dual setup but the main monitor (with the 240 Hz) freezes for some seconds and acts weird (short blackscreen flicker as well).

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 15, 2018, 10:26pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/8 "2018-12-15T22:26:18Z")

</div>

it might be worth checking whether you have Focus Assist on, as this does some odd things with ALT+TAB:

> [@Unacceptably long alt+tab on Windows 10](http://discourse.glfw.org/t/unacceptably-long-alt-tab-on-windows-10/1120/3):
>
> I’ve tracked the problem down via a search online and confirmed it’s a new Windows 10 feature called focus assist. See here for fix:

---

<div class="post-metadata">

**Author:** ![haubna](https://avatars.discourse-cdn.com/v4/letter/h/6a8cbe/32.png) [@haubna](https://discourse.glfw.org/u/haubna)\
**Post date:** [December 15, 2018, 10:43pm UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/9 "2018-12-15T22:43:29Z")

</div>

Ok at least now I know why I get that behaviour. It’s not the Windows 10 bug but the glfwPollEvents function blocks my main loop for 1 to 3 seconds. Do you know why? I made a clear setup with only one window and no callbacks and this still happens.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 16, 2018, 11:49am UTC](https://discourse.glfw.org/t/glfw-disable-restoring-resolution-of-fullscreen-window/1230/10 "2018-12-16T11:49:53Z")

</div>

I’m not sure what would cause that other than the Focus Assist issue, or another OS call blocking. If you need a workaround you could put the rendering on another thread (events processing has to stay on the main thread).

There is an [events.c test](https://github.com/glfw/glfw/blob/master/tests/events.c) which is useful for looking at event issues, but it doesn’t run in fullscreen so you’d need to alter it to take a look at what’s going on, or you could try using Visual Studio profiling to see if that shows anything.
