Repository: spyder-ide/spyder

Issue:
Variable explorer viewers go to the background 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! --->

### Issue Report Checklist

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
Hi there, using spyder on both windows and mac os, I noticed an odd behaviour compared on Mac OS comapred to the windows version.

On windows, I can easily open and explore different variables at the same time for comparison purpose. On Mac OS, when i open a second variable window, the first one would disapear behind spyder windows.




### What steps reproduce the problem?

1. Create at least two array, dataframe,list....
2. Inspect them with the variables explorer on Mac OS
3. 

### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## 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: last one
* Python version: 
* Qt version: 
* PyQt version: 
* Operating System name/version: 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
@goanpeca, is there something we can do about this?
Will look into it

@lschneidpro like this?

![varexp](https://user-images.githubusercontent.com/3627835/55661510-c962fd80-57d1-11e9-8901-10615fb286c2.gif)

@ccordoba12 should this go to 3.x?
@goanpeca

yes, looks good
> should this go to 3.x?

Sure, it's a very simple fix.

Resolving patch:
diff --git a/spyder/widgets/variableexplorer/collectionseditor.py b/spyder/widgets/variableexplorer/collectionseditor.py
--- a/spyder/widgets/variableexplorer/collectionseditor.py
+++ b/spyder/widgets/variableexplorer/collectionseditor.py
@@ -1421,8 +1421,13 @@ def setup(self, data, title='', readonly=False, width=650, remote=False,
         self.setWindowTitle(self.widget.get_title())
         if icon is None:
             self.setWindowIcon(ima.icon('dictedit'))
-        # Make the dialog act as a window
-        self.setWindowFlags(Qt.Window)
+
+        if sys.platform == 'darwin':
+            # See: https://github.com/spyder-ide/spyder/issues/9051
+            self.setWindowFlags(Qt.Tool)
+        else:
+            # Make the dialog act as a window
+            self.setWindowFlags(Qt.Window)
 
     @Slot()
     def save_and_close_enable(self):


Test patch: