Repository: spyder-ide/spyder

Issue:
Master: There is an area in the top left of spyder that is unclickable
### Issue Report Checklist

* [x] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [x] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [x] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [x] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [x] Tried basic troubleshooting (if a bug/error)
    * [x] Restarted Spyder
    * [x] Reset preferences with ``spyder --reset``
    * [x] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [x] Tried the other applicable steps from the Troubleshooting Guide
* [x] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description

On master (version 4) there is an area were there is no mouse interaction on the toolbar in the top left.

See how the buttons don't react to the mouse:

![the box of unclickability](https://user-images.githubusercontent.com/10513354/39948987-a3e9fc56-5535-11e8-916f-7e4fead2e393.gif)

They also don't register clicks.


### What steps reproduce the problem?

1. Start Spyder Master
2. See that you can only click the bottom part of the buttons in the top left of the toolbar

### What is the expected output? What do you see instead?

You should be able to click them.



## 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. --->

From anaconda in a new environ.
Spyder started from the command line with ```./bootstrap.py --test```

* Spyder version: current master
* Python version: 3.6.5 64bits
* Qt version: 5.9.4
* PyQt version: 5.9.2
* Operating System name/version: Ubuntu 16.04

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.4.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  None (NOK)
numpy >=1.7      :  None (NOK)
sphinx >=0.6.6   :  1.7.4 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.11.0    :  0.12.0 (OK)
psutil >=0.3     :  5.4.5 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  None (NOK)
cython >=0.21    :  None (NOK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.4.0 (OK)
pylint >=0.25    :  1.8.4 (OK)
```



Discussion:
Thanks @bcolsen Under Windows 8.1, Spyder ``master`` ``37c9491c`` (latest as of post time), Python 3.6.4 x64 and Qt/PyQt 5.6 I'm also seeing the same thing, just much smaller in apparent height, possibly due to the menu bar taking up an equivalent amount of space. The red area in the following graphic is unclickable:

![image](https://user-images.githubusercontent.com/17051931/39958811-a7509254-55cd-11e8-9349-3c40814f7d8c.png)

Meanwhile, on both Spyder 3.2.8 and Spyder ``3.x`` ``b293dc10`` I see no such thing.

I'm not a Qt expert, but a wild guess might be that some invisible Qt Widget or other such UI object is present, positioned with a top left corner anchored at the top left corner of the window frame (regardless of menu bar position) over top of the normal UI that is blocking clicks. But I'd have to refer it to someone who really knows something, like @ccordoba12 .
Yeah, there's probably a hidden widget there.
I can also reproduce this exactly like @CAM-Gerlach explained.

If this is due to a hidden widget blocking the toolbar, I was not able to confirm it, nor to identify it.

I only found two related issues on the web, both without any answer:
- https://stackoverflow.com/questions/34210778/qtoolbar-button-mouse-clicking-not-working
- https://forum.qt.io/topic/26993/qtoolbar-first-item-not-clickable/6

I hope one of you guys can solve this. Else, a valid workaround would be to add at the end of the `setup` method in the `MainWindow` class:

```
for tb in self.toolbarslist:
    tb.raise_()
```
@jnsebgosselin, the hidden widgets blocking the File toolbar are probably the Options menu of plugins without a dock widget (like the LSP manager or the working directory).

So your solution of raising all our toolbars seems appropriate here. Could you submit a PR for it? Thanks!
> 
> 
> @jnsebgosselin, the hidden widgets blocking the File toolbar are probably the Options menu of plugins without a dock widget (like the LSP manager or the working directory).
> 
> So your solution of raising all our toolbars seems appropriate here. Could you submit a PR for it? Thanks!

Yes, this is right.

The problem is not with the Options menu, but the  plugin themselves that inherit from QWidget. We need to explicitly hide those plugins. This include the `LSPManager` and the `WorkingDirectory`. After doing that, the problem disappears.

In the screenshot below, you can see the empty `WorkingDirectory` in red, that span above the Toolbar, but below the Menus. I recall that at some point, the _File_, _Edit_ and _Search_ menus were not clickable too, but someone must have fixed that with a raise or something.

I'll submit a PR to explicitly hide those two plugins soon.

![image](https://user-images.githubusercontent.com/10170372/47226725-3b17ce00-d38f-11e8-86ce-9d32c9463c7a.png)






Resolving patch:
diff --git a/spyder/plugins/lspmanager.py b/spyder/plugins/lspmanager.py
--- a/spyder/plugins/lspmanager.py
+++ b/spyder/plugins/lspmanager.py
@@ -669,6 +669,7 @@ class LSPManager(SpyderPluginWidget):
     def __init__(self, parent):
         SpyderPluginWidget.__init__(self, parent)
         self.options_button.hide()
+        self.hide()
 
         self.lsp_plugins = {}
         self.clients = {}
diff --git a/spyder/plugins/workingdirectory/plugin.py b/spyder/plugins/workingdirectory/plugin.py
--- a/spyder/plugins/workingdirectory/plugin.py
+++ b/spyder/plugins/workingdirectory/plugin.py
@@ -49,6 +49,7 @@ class WorkingDirectory(SpyderPluginWidget):
     
     def __init__(self, parent, workdir=None, **kwds):
         SpyderPluginWidget.__init__(self, parent)
+        self.hide()
 
         self.toolbar = QToolBar(self)
 


Test patch: