Search Unity

[Solved] Fullscreen switch from windowed to fullscreen not working, despite option being ticked.

Discussion in 'Linux' started by stevepdp, Jul 19, 2021.

  1. stevepdp

    stevepdp

    Joined:
    Dec 12, 2016
    Posts:
    4
    Hi everyone.

    I have several Unity jam games that under Windows intentionally start windowed at 1280x720. This is so as to meet jam rules in most cases where streamers prefer games not to open fullscreen by default.

    I have the fullscreen switch option enabled in player settings so that users can take these games fullscreen at that same resolution. This works on Windows A-OK!

    With my Linux builds however, that's not the case. The game will open in a window as intended, but no amount of key combinations seems to make them switch to fullscreen.

    The target I'm testing on is a Thinkpad X250 with an Intel GPU. It's running Ubuntu 20.04 and the resolution is 1920x1080. The problem persists no matter the desktop environment. I've tried GNOME, KDE and Fluxbox to the same effect.

    I would greatly appreciate some insight on this. Perhaps the feature simply doesn't work on Linux?

    I have tried clearing the user preferences under ~/.config too, but to no avail.

    Thanks.
     
    Last edited: Jul 20, 2021
  2. stevepdp

    stevepdp

    Joined:
    Dec 12, 2016
    Posts:
    4
    Here's the settings I've applied.
     

    Attached Files:

  3. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    You could try something like this (example using CTRL+RETURN to toggle),
    Code (CSharp):
    1. if (Input.GetKey(KeyCode.RightControl) && Input.GetKeyDown(KeyCode.Return))
    2. {
    3.   if (Screen.fullScreen)
    4.   {
    5.     Screen.SetResolution(1280, 720, false);
    6.   } else {
    7.     Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true);
    8.   }
    9. }
     
    stevepdp likes this.
  4. stevepdp

    stevepdp

    Joined:
    Dec 12, 2016
    Posts:
    4
    Thanks. This worked a treat!

    It hadn't occurred to me that it might involve a code solution.

    I can certainly provide Linux builds now
     
    adamgolden likes this.