FS#4449 - [Windows] Fullscreen as borderless window at desktop resolution

Attached to Project: OpenTTD
Opened by Lauri Nurmi (ln) - Saturday, 29 January 2011, 17:23 GMT
Last edited by andythenorth (andythenorth) - Saturday, 02 September 2017, 12:06 GMT
Type Feature Request
Category Interface
Status With patch
Assigned To andythenorth (andythenorth)
Operating System Windows
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Entering fullscreen on Windows makes you regret you ever clicked the button or pressed Alt-Enter.

The desktop resizes to something ridiculously small, and when that happens, the Windows taskbar on the bottom also resizes permanently. That means the program icons are limited to the first 640 horizontal pixels of the taskbar even after you exit the fullscreen. It is fixable, but not quite obvious how.

Also while in fullscreen, it is not possible to move the mouse cursor to the second screen on a multi-display configuration.

When you have an LCD screen with a physical native resolution of 1920x1080, or whatever above VGA, do you actually ever want to run OpenTTD at 640x480 in fullscreen? Or any resolution other than the one native to the screen?

Instead of changing the real screen resolution it would be much better to create a borderless window matching the desktop resolution, a window that would still cover the taskbar.
This task depends upon

Comment by Remko Bijker (Rubidium) - Saturday, 29 January 2011, 18:47 GMT
Sounds like OpenTTD's resolution was set to 640x480 when you told it to go to full screen (at that resolution).

In any case, there are many that play 800x600 on a 1600x1200 monitor or something similar to get larger graphics and I doubt we want to remove that possibility. Having this possibility does mean we can't use a borderless window; we have to change the actual resolution of the screen.

I think that starting OpenTTD maximized is rude to the player; any program that starts maximized annoys me enormously.

I don't think we can do much about the behaviour of Windows when we let the application go into full-screen (the messing up of stuff on the desktop and such are all done by Windows). I reckon all other applications that use Windows' full-screen functionality have the exact same issues. OpenTTD might even use the 8bpp hardware acceleration when in proper full-screen, although it might very well be that most recent drivers are lacking that possibility.
Comment by Lauri Nurmi (ln) - Saturday, 29 January 2011, 21:16 GMT
Yes, I am not saying messing up the desktop is an exclusively OpenTTD-specific problem, but there are some games that do this more nicely (probably by not touching the actual screen resolution). Civilization V Demo and Microsoft Flight Simulator to name a few.

Also I am not suggesting OpenTTD should be started maximized by default, but rather the "maximized" borderless window would replace the real fullscreen mode, and the regular windowed mode would work like before.
Comment by minexew (minexew) - Saturday, 06 June 2015, 08:23 GMT
Has there been any development on this?

Patches welcome?
Comment by minexew (minexew) - Saturday, 06 June 2015, 10:36 GMT
Please have a look at the attached patch. (for convenient viewing:

It changes the Win32 video driver in the following way: when a full-screen mode is requested, the current display resolution is checked and if it is identical to the requested fullscreen resolution, ChangeDisplaySettings is not used and a borderless fullscreen window is created instead. This doesn't break the use-case of intentionally using low-resolution fullscreen.
I've tested it on a multi-monitor setup and everything seems to work as before, except you can now switch to other windows without the screen flashing and mouse cursor flying all over the place.

As for the 8bpp hardware acceleration, has that ever worked?
Comment by Lauri Nurmi (ln) - Sunday, 26 July 2015, 11:41 GMT
Great, with the patch the fullscreen mode works as I hoped!

Two things to improve though:
* Remember the initial resolution of the windowed mode and change back to that when exiting fullscreen.
* Use the location of the window to determine which display should be used for fullscreen mode -- right now it's always the primary display.