[Linux] Can't change screen resolution #845

demonixis opened this Issue Oct 6, 2012 · 5 comments


None yet

5 participants



On the develop3d branch, the screen resolution on linux can't be changed. I've tested a lot of hack but i can't change resolution with :

graphics.PreferredBackBufferWidth/Height = 1280/800

Thanks for you reply


There are a lot of issues on the subject, but I don't think there's a solution yet.
Currently it seems to be stuck to 640x480 on Linux... waiting for this one as well


I got the same problem. I'm quite new to mono game, so what I just did is probably the most dirty hack, but it helps if you want to take screen shots or shoot a video under Linux and need sort of a higher resolution. This works only for the full screen mode.

I recognized that OpenTKGameWindow.OnResize is called once after the game has started and sets the window back to 640x480.

So I simply commented the line in OpenTKGameWindow.Initialize which adds this function to the resize event listener:
// window.Resize += OnResize;

In OpenTKGameWindow.AllowUserResizing right below where it says "// TODO: this is buggy on linux - report to opentk team" I just replace WindowBorder.Fixed with WindowBorder.Resizeable.

This is by all means not a solution to the problem, as weird things happen if you run the game in window mode. I guess we will have to wait for that OpenTK fix, as I have no idea where, when and most importantly why the Resize event of the OpenTK window is invoked. For now this might help if you want to show footage of your game under Linux.


I think you can get this working with a hack. You have to change the resolution in the Draw method. Something like this should work:

if (this.changeResolution)
    graphics.PreferredBackBufferWidth/Height = 1280/800

    this.changeResolution = false;

Hi, thanks for your help.

This hack seems not to work for me though. When I set changeResultion to true in or before the Initialize event the screen changes shortly but then OpenTKGameWindow.OnResize is called again with 640x480 size. But that doesn't seem to be the issue, as if I comment OnRsize out it still does nothing. Maybe I'm missing something here. I also tried to set changeResultion to true a few seconds into the game, but it didn't do anything either.

MonoGame member

This should be working under the latest OpenTK.

@tomspilman tomspilman closed this Apr 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment