Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Ubuntu Return to Windowed Mode bug

Discussion in 'Linux' started by Domi47, Oct 20, 2021.

  1. Domi47

    Domi47

    Joined:
    Feb 4, 2021
    Posts:
    10
    Hello everyone,

    I create a robot simulator using the Unity Robotics Hub packages and Unity 2020.3.11f1. I use Ubuntu 18.04 for developing the application, that must work with Ubuntu 18.04 and 20.04.

    I want this app to change from Windowed Mode to Fullscreen Mode, which are the only modes that work in Ubuntu according to this documentation https://docs.unity3d.com/Manual/class-PlayerSettingsStandalone.html , but I have encountered some problems.

    I build this app with the following settings:
    settings.png

    First, once the app is built, despite having the option 'Allow Fullscreen switch' checked, that according to documentation "Enable this option to allow default OS full-screen key presses to toggle between full-screen and windowed modes", when pressing Alt+F10 it just changes from a minimized to maximized window and the opposite, but never to Fullscreen (where the top bar shouldn't be visible).


    Second, if change the screen mode through a script for example doing:

    Code (CSharp):
    1. if(Input.GetKey(KeyCode.F1)){
    2.  
    3.      is_fullscreen = !is_fullscreen;
    4.      Screen.fullScreen = is_fullscreen;
    5. }
    Or:

    Code (CSharp):
    1. if(Input.GetKey(KeyCode.F1)){
    2.  
    3.    is_fullscreen = !is_fullscreen;
    4.  
    5.    if(is_fullscreen){
    6.                 Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
    7.    }
    8.     else{
    9.                 Screen.fullScreenMode = FullScreenMode.Windowed;  
    10.     }
    11. }
    Then, the app starts in windowed mode, so I can see my scene well and also the top bar. When I press F1 the app changes to full screen so I stop seeing the top bar, all this is fine. But when I press F1 again and return to windowed mode the scene is all black. I can see the top bar, minimize and maximize the window or move it, but I can't see the scene. I can always return to Fullscene and it works, I see the scene well. But always I return to windowed mode the scene is black.

    A last question, the Unity Robotics Hub packages say they work in ROS Melodic (Ubuntu 18.04) and ROS Noetic (Ubuntu 20.04). This last one is the last LTS now and the standard. But still Unity Hub is not supported officially for Ubuntu 20.04 according to the main page https://unity3d.com/es/get-unity/download . Is it planned an Unity Hub for Ubuntu 20.04?

    Thank you.
     
  2. GoodDH

    GoodDH

    Joined:
    Apr 23, 2023
    Posts:
    1
    H
    Have you found a solution? I have the same problem, when I convert the resolution, the screen goes black and I can't see anything.
    Looking forward to your reply. Thanks~