Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Multi-Display Windowed Mode

Discussion in 'Scripting' started by BisuDagger, Sep 6, 2016.

  1. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    Hello unity forumers,
    I have a fully functioning multi-display system. When ever it is running, it auto-maximizes the screens on both displays. This causes one major issue because it removes the frame around the player (the frame with the minimize, maximize, and exit button in the top right corner). I need to be able to get that frame back around the main player window and am not sure how to make that possible. If anyone one has a solution or suggestions please share. Thank you!

    StartScreen.png FullScreen.png EndScreen.PNG

    Regards,
    BD
     
  2. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
  4. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    Sent a PM with all the code from my display system. If anyone else is interested, then I will share snip-its here.
     
  5. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    @karl_jones , An alternative to windowed mode in MD would be to do a reset on the display system so that way display 2 is deactivated again. When I leave the scenarios that require MD I return to the start screen. Is there a way to call a reset on the unity system? What we are trying to avoid is the user having to quit the player in order to have function single display lessons after having completed a MD lesson.

    Hopefully: Display.displays[1].DeActivate(); is added and supported in the future.
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    I'll reply here to above and your PM so everyone can benefit.

    I noticed you are using renderingWidth/renderingHeight, I fixed a problem with that yesterday. It was returning the system height/width not rendering so this may cause issues if they are not the same.
    I also fixed a bug with getting the mouse cursor not working outside of the main display, this will work in the future once the fix comes out (2~ weeks).

    At the moment it is not possible to disable MD once it is activated, i'll investigate how feasible it is although the MD code is something I have only just started to look into so i'll need to ask one of the other devs.

    I have also noticed that setting the resolution through the Activate function seems to provide better results than using SetParams when starting up.
    As I said i'm still learning this area, i'm in the middle of writing a blog post on it to help provide example etc but it's still early days.

    Karl
     
  7. n1ntendo

    n1ntendo

    Joined:
    Feb 9, 2013
    Posts:
    2
    Go @karl_jones ! @BisuDagger gets super excited when you provide help to him and he's KIND OF AN ogre.... so thank you for making him happy and helping him :p
     
    djfunkey and karl_jones like this.
  8. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    BisuDagger searches for his beating club.



    @n1ntendo
     
  9. jeroenvdv

    jeroenvdv

    Joined:
    Oct 25, 2010
    Posts:
    41
    Any news on this? I'm looking for the same result as BisuDagger; being able to run windowed on the primary monitor while having one or multiple external monitors in full screen.
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    Hi. No this is not currently supported. We are looking to improve the multiple display system but no eta yet.
     
  11. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    @karl_jones thank you for keeping up with this thread. Is there anyway way we can get access to deactivating multidisplay? Returning the screen to single display mode is a necessity for me. Even seeing the hidden code that activates multidisplay would be a huge help. This is putting a halt on a major project of mine and it actually has recently prevented a product from being shipped.
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    Hi,
    At the moment we dont have any built in support for disabling a display once it's activated.
    On windows we use CreateWindowEx. It looks like we do disable the display if we lose the device, maybe there is a way to force it to disable? I dont think its going to be possible to workaround at the moment though.
    I have not tried this but perhaps you could move the display offscreen using SetParams and disable its camera so its inactive?
     
  13. BisuDagger

    BisuDagger

    Joined:
    May 2, 2014
    Posts:
    31
    I actually had a big win this morning after posting here. https://www.assetstore.unity3d.com/en/#!/content/30563
    This unity store asset has a call "Window.Border()" that resets the sim and returns the boarder to the window. It fits perfectly with my case scenario where the user will leave a lesson and return to the start screen anyway. This is a super useful plugin for anyone needing it in the future.
     
    Last edited: Sep 28, 2016
    karl_jones likes this.
  14. evisave

    evisave

    Joined:
    Oct 15, 2013
    Posts:
    1
    Hi,
    same problem here. Is there any solutions currently?
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    Not at the moment (other than running 2 instances of Unity). I suggest you add any feedback, feature request to here http://feedback.unity3d.com/
    We want to improve the multi display support so this will help us put together our roadmap in the future.
     
    evisave likes this.
  16. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    697
    ANY UPDATES TILL NOW we havent got deactivate system .added
     
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    Hi,
    It's not currently on our roadmap. The multiple display system needs a big overhaul before we can start adding new features.
     
  18. nonnicram

    nonnicram

    Joined:
    Apr 3, 2014
    Posts:
    12
    Hi,

    ok, as i understood its not possible to have one screen on "window mode" and the other screen on "fullscreen mode". But is it possible to have both on windowed mode or means several displays always full screen mode?

    Thanks for the info!

    Cheers, Marc
     
  19. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,145
    No when using multiple display they are all full screen. It would be nice to support this in the future but no plans at the moment to do so.
     
  20. nonnicram

    nonnicram

    Joined:
    Apr 3, 2014
    Posts:
    12
    Hey karl_jones,

    actually i found a solution to get multiple displays in "windowed" mode. It works even with one fullscreen and one windowed display. At the end I needed two displays in window mode so i set up three displays on my Computer. In my Unity scene i set up 2 Cameras and subscribed them to display 2 and 3. One of my 3 displays is empty. With this i get two displays in windowed mode.

    In a script on a gameobject is just said:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System;
    4. using UnityEngine.UI;
    5.  
    6. public class DisplayScript : MonoBehaviour
    7. {
    8.     int width = 1730;
    9.     int height = 570;
    10.     int xpos = 130;
    11.     int ypos = 240;
    12.  
    13.     int width2 = 1920;
    14.     int height2 = 1000;
    15.     int xpos2 = 0;
    16.     int ypos2 = 0;
    17.  
    18.     void Awake()
    19.     {
    20.         if (Display.displays.Length > 1)
    21.         {
    22.             Screen.fullScreen = false;
    23.             Display.displays[1].SetParams(width2, height2, xpos2, ypos2);
    24.             Display.displays[1].Activate(width2, height2, 60);
    25.  
    26.         }
    27.         if (Display.displays.Length > 2)
    28.         {
    29.             Screen.fullScreen = false;
    30.             Display.displays[2].SetParams(width, height, xpos, ypos);
    31.             Display.displays[2].Activate(width, height, 60);
    32.  
    33.  
    34.         }
    35.     }
    36. }
    I am on Unity 2018.2.6f1
     
  21. unity_DYSYd8Yxl-YL7w

    unity_DYSYd8Yxl-YL7w

    Joined:
    Aug 7, 2018
    Posts:
    1
    Hi,

    Is it possible to have display[0] windowed and all other displays at fullScreen?
     
  22. nonnicram

    nonnicram

    Joined:
    Apr 3, 2014
    Posts:
    12
    Hey,

    i am not sure, but you can test the code above setting the display[0] to "Screen.fullscreen = true".

    Good luck.