Repository: spyder-ide/spyder

Issue:
An extra window running on Windows 11
I use Spyder 5.1.5 via conda on Windows 11, when I start spyder by windows terminal, it says:
```
link image0 hasn't been detected!
```
and run an extra window:
![image](https://user-images.githubusercontent.com/65082432/139541496-21522a2c-515a-4fd6-9301-4780291d5cff.png)



Discussion:
Hey @Firestar-Reimu, thanks for reporting. We have noticed this before, but the window usually disappear after Spyder finishes loading.

Could you try to expand it to see what it contains?
It is an all-black screen, and if I close it, it does not influence the spyder window.

Screenshot: https://imgur.com/a/koKdn1K
Updated today, not fixed, and `link image0 hasn't been detected!` error still exists
I meet the same problem.
Same problem on Windows 10, Python 3.8.
> I meet the same problem.

I solved the problem by resetting the win11 user's filename in English.
@dalthviz, please take a look at this one. It should be a matter to detect what widget is not added to a layout when instantiating our plugins.

The ability to turn off plugins added in PR #16012 will be of great help here.
I'm not totally sure to follow what is needed to do here @ccordoba12 

Also, @williamdwl to fix this did you reset your Windows user profile/user folder name to an English variant?
I have a english username

My windows was Chinese but I change the locale to UTF-8

which my `chcp` default is 65001
> I have a english username
> 
> My windows was Chinese but I change the locale to UTF-8
> 
> which my chcp default is 65001
> 

Thanks for the new info @Firestar-Reimu ! Changing the locale for you helped with the strange behavior of extra windows and the `link image0 hasn't been detected!` message?
> I'm not totally sure to follow what is needed to do here @ccordoba12

The thing is while Spyder starts up on Windows, it shows some extra, tiny windows around. On Windows 10 they are hidden after Spyder finishes loading, but it seems they remain up on Windows 11.
I recently upgraded Spyder from 4 to version 5 on Ubuntu 20.04 and I am also getting "link image0 hasn't been detected!" on startup. Also, many icons seem to be missing and red X is displayed instead. I installed using conda. Full message on startup:
```
link image0 hasn't been detected!
libpng warning: bKGD: invalid
libpng warning: bKGD: invalid
```
An example of missing icons:
![Screenshot from 2021-12-16 21-55-44](https://user-images.githubusercontent.com/11771536/146440473-c02f734e-6b95-4038-8a93-91d930918cdf.png)


> > I have a english username
> > My windows was Chinese but I change the locale to UTF-8
> > which my chcp default is 65001
> 
> Thanks for the new info @Firestar-Reimu ! Changing the locale for you helped with the strange behavior of extra windows and the `link image0 hasn't been detected!` message?

No, I have always been in this config (english username, locale=UTF-8), and I always got this message: `link image0 hasn't been detected!` and an extra window.

PS: I am using pycharm now, waiting for spyder to update.
Same problem...
I also get the "link image0 hasn't been detected!" message in the miniconda command prompt when launching Spyder 5.1.5 (Python 3.9.7 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Windows 10). As far as I can tell, application functionality is not impacted but I'm a new user so I can't say for certain. I do not see any mysterious windows opening during startup.
After checking this for sometime:

Seems like the plugins generating the extra windows are: `Python Interpreter`, `Completions` and  `Editor`

Maybe the extra windows are related with the management of the plugins Container class/ConfigPage/Status bar class or not being migrated (in the case of the Editor)

Regarding the `link image0 hasn't been detected!` I was able to get it by creating a env with Python 3.9.7 using the default channel and then installing Spyder. So something like this: 

    conda create -n spy python=3.9.7
    conda activate spy
    conda install spyder

Doing a similar setup but using the conda-forge channel doesn't show the `link image0 hasn't been detected!` message. So using something like:

    conda create -n spyforge -c conda-forge python=3.9.7
    conda activate spyforge
    conda install -c conda-forge spyder=5.1.5

However with this env I'm getting the `rtree` faulty installation warning :|

> However with this env I'm getting the rtree faulty installation warning

 What is that?
> link image0 hasn't been detected!

I am getting this on macOS 12.1. I see no extra windows and no additional messages in the terminal. Spyder seems to be running fine otherwise. I installed via `conda`. I'm wondering if the other issues mentioned in this thread are coincidental. 
<img width="662" alt="Screen Shot 2021-12-28 at 11 51 18 PM" src="https://user-images.githubusercontent.com/1412598/147628436-e96cdda6-b4ce-4202-9926-d0bc33e04c1d.png">

>     However with this env I'm getting the rtree faulty installation warning
> 
> What is that?

@Firestar-Reimu is a dialog informing that a dependecy (`rtree`) is not installed/its version could not be retrived due to a corrupted/faulty installation. A related issue in case you want to know more: https://github.com/spyder-ide/spyder/issues/16583
> Seems like the plugins generating the extra windows are: Python Interpreter, Completions and Editor

Ok, then I think I know what's the problem: those plugins create status bar widgets, but they are only added to the interface once the Status bar plugin is initialized.

So perhaps we should leave the creation of those widgets only when the Status bar is initialized?

Resolving patch:
diff --git a/spyder/api/widgets/status.py b/spyder/api/widgets/status.py
--- a/spyder/api/widgets/status.py
+++ b/spyder/api/widgets/status.py
@@ -102,12 +102,12 @@ def set_layout(self):
             self._icon = self.get_icon()
             self._pixmap = None
             self._icon_size = QSize(16, 16)  # Should this be adjustable?
-            self.label_icon = QLabel()
+            self.label_icon = QLabel(self)
             self.set_icon()
 
         # Label
         if self.show_label:
-            self.label_value = QLabel()
+            self.label_value = QLabel(self)
             self.set_value('')
 
             # See spyder-ide/spyder#9044.
@@ -214,7 +214,7 @@ def __init__(self, parent=None):
         self.label_value.setMinimumWidth(fm.width('000%'))
 
         # Setup
-        self.timer = QTimer()
+        self.timer = QTimer(self)
         self.timer.timeout.connect(self.update_status)
         self.timer.start(self._interval)
 


Test patch: