# BUG: incorrect window size in fullscreen

**URL:** <https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122>\
**Category:** Bugs\
**Created:** [August 13, 2018, 8:44pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122 "2018-08-13T20:44:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![connor.halford](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/connor.halford/32/9210_2.png) [@connor.halford](https://forum.defold.com/u/connor.halford)\
**Post date:** [August 13, 2018, 8:44pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/1 "2018-08-13T20:44:22Z")

</div>

My monitor is 1440x900 and I’m running Windows 10. I have the following in my render script’s update function:

```lua
print(render.get_width().."x"..render.get_height())
print(render.get_window_width().."x"..render.get_window_height())

```

In my game.project file I have the width and height set to 840x494. With fullscreen unticked, as I resize the window I get correct sizes in the log. With the taskbar hidden and the window maximized I get:

```lua
DEBUG:SCRIPT: 840x494
DEBUG:SCRIPT: 1440x877

```

This is correct since the title bar is 23 pixels tall. However with the fullscreen setting in game.project ticked I get:

```lua
DEBUG:SCRIPT: 840x494
DEBUG:SCRIPT: 800x600

```

Even though I should be getting 1440x900, it’s drawing at 800x600 then stretching it to 1440x900 and making it distorted and blurry. Trying some other values for the width and height in game.project produce different results:

```lua
DEBUG:SCRIPT: 1840x494
DEBUG:SCRIPT: 1366x768

DEBUG:SCRIPT: 840x1494
DEBUG:SCRIPT: 1280x1024

```

The renderer seems to be forced to one of a possible set of resolutions, which is not at all expected and doesn’t match the behaviour when fullscreen isn’t ticked. In windowed mode render.get\_window\_width() and render.get\_window\_height() return the client size of the window, which in fullscreen I would expect to be 1440x900.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [August 13, 2018, 9:10pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/2 "2018-08-13T21:10:24Z")

</div>

Have you tried to use DefOS to toggle fullscreen?

---

<div class="post-metadata">

**Author:** ![maybell](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/maybell/32/34732_2.png) [@maybell](https://forum.defold.com/u/maybell)\
**Post date:** [March 23, 2024, 2:30pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/3 "2024-03-23T14:30:31Z")

</div>

isn’t this an issue with defold? fullscreen is rendering incorrectly, stretching the image instead of natively using the monitor resolution. this issue is still happening. an extension just to get a functioning fullscreen doesn’t make sense.

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 23, 2024, 3:02pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/4 "2024-03-23T15:02:24Z")

</div>

I think we need more information to consider it an issue or not, we haven’t had any bug reports regarding it for a long time. Do you have a repro case perhaps?

---

<div class="post-metadata">

**Author:** ![maybell](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/maybell/32/34732_2.png) [@maybell](https://forum.defold.com/u/maybell)\
**Post date:** [March 23, 2024, 3:15pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/5 "2024-03-23T15:15:00Z")

</div>

it could be my render script and not related to the original post. let’s find out:

for each window resize callback, the render target is changed to fill the window as much as pixel perfect possible. does fullscreen in game project settings trigger this callback? if not, this would cause this issue since the render target is not being resized when the window is fullscreen’d.

i need the functionality to toggle fullscreen, and if this is not possible with default defold scripting, i will try defOS.

i would very much like to ask this to be considered as a feature request, it makes defold feel like it is not a desktop-capable engine, which makes me sad. ☹

---

<div class="post-metadata">

**Author:** ![jhonny.goransson](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jhonny.goransson/32/3864_2.png) [@jhonny.goransson](https://forum.defold.com/u/jhonny.goransson)\
**Post date:** [March 23, 2024, 8:50pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/6 "2024-03-23T20:50:32Z")

</div>

Well, this could still be an issue with your render script or overall set up. If you can provide a repro case can take a look!

---

<div class="post-metadata">

**Author:** ![Sigma](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sigma/32/39610_2.png) [@Sigma](https://forum.defold.com/u/Sigma)\
**Post date:** [May 8, 2025, 4:54pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/7 "2025-05-08T16:54:39Z")

</div>

Add me to the list of not working fullscreen feature. In my case render.get\_window\_width() returns 1024 instead of 1360. That’s probably the reason why I’m facing flickering problems.

---

<div class="post-metadata">

**Author:** ![SuperEly](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/superely/32/36691_2.png) [@SuperEly](https://forum.defold.com/u/SuperEly)\
**Post date:** [May 8, 2025, 5:17pm UTC](https://forum.defold.com/t/bug-incorrect-window-size-in-fullscreen/27122/8 "2025-05-08T17:17:55Z")

</div>

I was only able to solve my screen problems using this camera:

> **[Orthographic](https://defold.com/assets/orthographic/)**
>
> The Orthographic Camera API makes it super easy to convert screen to world coordinates, smoothly follow a game object and create a screen shake effect.
