Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Minchuilla · Aug 13, 2017 at 03:42 PM · displays

Deactivate display (multi-display)

Says it in the title but to clarify... When using multiple monitors you can call the Display.displays.Activate() to activate the application on more than one screen. But how do you deactivate a secondary screen without having to restart. Else is it advisable not to use multi-displays, because I haven't seen much support for it?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DizzyWascal · Jun 05, 2018 at 06:11 AM 0
Share

Have you found a workaround? Been trying to get around this issue.

I've created a post on Feedback for this request https://feedback.unity3d.com/suggestions/multi-display-display-dot-deactivate-function

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by DizzyWascal · Jun 18, 2018 at 10:25 AM

I finally got a workaround but only for Windows.

Since the name of the Secondary Display is always "Unity Secondary Display" I just created a .exe using .Net Framework to find and hide it fully.

The script and the exe can be downloaded here.

Will need to figure out code for linux and mac however.

To apply in runtime just have that .exe file somewhere and use the code:

 Process process = new Process();
 
 // Stop the process from opening a new window
 process.StartInfo.RedirectStandardOutput = true;
 process.StartInfo.UseShellExecute = false;
 process.StartInfo.CreateNoWindow = true;
 
 // Setup executable and parameters
 process.StartInfo.FileName = @Application.streamingAssetsPath + "/" +  "Third Party Functions/Minimise Secondary Display/Windows/Windows-Minimise-Secondary.exe";
 //process.StartInfo.Arguments = "--test";
 
 // Go
  process.Start();


In my case I put it into my Streaming Asset Path.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DizzyWascal · Jun 18, 2018 at 10:31 AM 0
Share

Also forgot to mention for the code it will require

using System.Diagnostics;

avatar image Minchuilla · Jun 18, 2018 at 10:59 AM 0
Share

Thanks for the answer! This is quite a hacky solution but looks like it works on windows. Personally I no longer need this capability but I hope this helps others.

avatar image TSCSimulation_AH · Sep 30, 2019 at 07:21 AM 0
Share

A year's necromancy on this thread, but can this work with three screens (i.e. a main display and two displays on either side)? They're both called "Unity Secondary Display" but the .exe only disables one, even if it is run twice it'll never disable the third screen.

Thanks if you reply!

avatar image
1

Answer by mikelortega · May 04, 2018 at 01:08 PM

Once activated, you cannot deactivate a display. It's explained in the documentation.

About if it's advisable using multi-display... well, sometimes you don't have another option and it works, but the functions are limited and I think that not everything works as expected. I hope they improve it in the future.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dastaut · Apr 24, 2020 at 09:46 AM 0
Share

That is true. I removed the unnecessary folders and files (e.g. Project Settings, Temp , .csproj, .sln). Opened the project, did a new build and the second screen was gone.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

71 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Display.displays length not updating 2 Answers

How to get Display.display[] to recognize a display other than Display.main? 0 Answers

I want one Canvas to show the same thing on two multi-displays. 0 Answers

Display.displays.length always returns 1 2 Answers

MultiDisplay - main display resolution changes itself to native 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges