Fullscreen on Chrome sometimes only uses a small part of the screen

It looks like this: Imgur: The magic of the Internet

Switching it off and on again will randomly give either proper fullscreen or this. Sometimes, just as randomly, the browser window is sized down to match the WebGL canvas when exiting fullscreen. This does not happen in FF, so I figure it’s a Chrome bug, but maybe there’s a workaround?

Hello Good old Grim.

Are you able to consistently reproduce this bug in Chrome with another content like an empty project for example? Can you reproduce the bug on another PC / in other versions of Chrome?

I am no longer able to reproduce the problem. In the meantime I upgraded Unity from 5.3.2 to 5.3.4, so I assume that fixed it. However, when exiting fullscreen, the Chrome window is now always sized down to match the canvas. This happens both in my real project and an empty test project, in Chrome 49.0.2623.87, as well as Canary 51.0.2682.0

The test project is just a sprite with a boxcollider and the following code:

public class NewBehaviourScript : MonoBehaviour {
   public void OnMouseDown()
  {
  Screen.fullScreen = !Screen.fullScreen;
  }
}

I’m experiencing the same issue with WebGL build from Unity 5.3.5f1 only in Chrome browser (Version 51.0.2704.63 m). Firefox and Edge works as it’s supposed.
I’m switching the fullscreen mode with the above code too.

Anyone have any clue?

Can report similar issue here as well.

Does anyone have a reproducible case for this they could send us in a bug report?

Same problem here with Chrome. However, it only happens for me when I use a WebGL template that makes the canvas scale with the browser size. When I use one of the two default templates, fullscreen works fine.

I have created a small test project that includes the template made by Virtual Playground (Full browser WebGL templates with CSS | virtualPlayground). If you build with this template, the fullscreen canvas in Chrome will be the same width as the windowed canvas. And if you build with one of the two standard templates, fullscreen works fine. Left mouse button toggles fullscreen mode. Right mouse button sets resolution to the monitor resolution. Interesting: if you are in windowed mode and you first click the right mouse button and then the left button, the canvas will span the entire screen.

2726188–193723–WebGLTesting.zip (558 KB)

Also, the problem is the same whether I use the Screen.fullScreen = !screen.Fullscreen method on mouse down or create a small Javascript plugin that calls SetFullscreen(0 and SetFullscreen(1)

Also having this problem with chrome 56 and unity 5.5.0f3 Any help would be much appreciated.

Same here (Chrome 56 and 5.5.0p1)

The canvas size in full screen is not updated to the new resolution I set. It renders correctly only a portion of the screen (corresponding to the default resolution of the plugin), the rest is visual garbage…

Regular: Imgur: The magic of the Internet
Fullscreen: Imgur: The magic of the Internet (the bug)

Bug reported: Case 883144

Thanks

@therealao could you submit a bug report?

Just let you know, I have just experienced the same issue here. Unity version 5.5.0F3 tested on Firebox.

If you have a simple repro, it would be great if you could submit a bug report (we already have one but a smaller project would be better)

I hope I’m not making this even more confusing, but we used to have the problem noted in the original post going all the way back to the initial Unity 5 release. I’m not sure if that bug is still the same fullscreen bug being reported now, but the original problem iirc was actually in the .css file. It was a timing issue. The width and height are set to 100%, but for some reason those pixel values are sometimes not updated in time. The width and height would then get set to wrong (old?) pixel values. The fix for us was setting the width and height values in the .css file to explicit pixel values every time the canvas size changed (including fullscreen) instead of just setting them to 100%.

But perhaps a different bug. Apologies in advanced if this has made things more confusing!

Hi,

(POTENTIAL SOLUTION FOR YOU BELOW)

By discussing the issue with Unity, in my case the issue was caused by the fact that I had one camera in Defered rendering path (the one rendering my asset in my showroom) and another camera with Forward rendering path (for the background of my showroom).

By setting both to Froward, the issue disappears. This is still an issue for me, but it could be a valid workaround for you until Unity fixes it.

Yvan

Hi Marco
I have the same issue that was resolved by disabling anti aliasing in the quality settings.