Repository: spyder-ide/spyder

Issue:
Titlebar doesn't use dark mode on macOS
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->


## Problem Description

The darkmode on macOS is not fully consistent when running from the macOS app, bootstrap, or bootstrap in debug mode. However, when launching the macOS app in debug mode, darkmode is consistent.

### What steps reproduce the problem?

1. Start the Spyder application OR start from bootstrap
2. Notice titlebar is not using darkmode
3. Close Spyder
4. Start Spyder application from commandline with `--debug-info=minimal`
5. Notice titlebar is using darkmode

<img width="400" alt="Screen Shot 2021-05-24 at 6 03 58 PM" src="https://user-images.githubusercontent.com/9618975/119430097-0269cf00-bcc5-11eb-91ca-685dc6eea5eb.png"><img width="400" alt="Screen Shot 2021-05-24 at 6 02 34 PM" src="https://user-images.githubusercontent.com/9618975/119430134-14e40880-bcc5-11eb-9c2c-3172e47862e2.png">

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 5.1.0.dev0 d6c81e575
* Python version: 3.9.5 64-bit
* Qt version: 5.9.7
* PyQt5 version: 5.9.2
* Operating System: Darwin 19.6.0

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
# Mandatory:
applaunchservices >=0.1.7     :  0.2.1 (OK)
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.22.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  23.0.1 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.9.0 (OK)
pylint >=1.0                  :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0          :  v5.0.3+43.gd6c81e575 (NOK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2;<0.4.0    :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.dev (NOK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.2 (OK)
qtconsole >=5.1.0             :  5.1.0 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=39.0.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  4.0.1 (OK)
spyder_kernels >=2.0.3;<2.1.0 :  2.1.0.dev0 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.1 (OK)
zmq >=17                      :  20.0.0 (OK)

# Optional:
cython >=0.21                 :  0.29.23 (OK)
matplotlib >=2.0.0            :  3.3.4 (OK)
numpy >=1.7                   :  1.20.2 (OK)
pandas >=1.1.1                :  1.2.4 (OK)
scipy >=0.17.0                :  1.6.2 (OK)
sympy >=0.7.3                 :  1.8 (OK)
```



Discussion:

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -188,7 +188,8 @@ def make_app_bundle(dist_dir, make_lite=False):
                                        'CFBundleTypeName': 'Text File',
                                        'CFBundleTypeRole': 'Editor'}],
             'CFBundleIdentifier': 'org.spyder-ide',
-            'CFBundleShortVersionString': SPYVER
+            'CFBundleShortVersionString': SPYVER,
+            'NSRequiresAquaSystemAppearance': False  # Darkmode support
         }
     }
 


Test patch: