Repository: spyder-ide/spyder

Issue:
Code completion window too small on high resolution screens
## Description of your problem
I have a new laptop with a resolution of 2560 x 1440 running the latest Windows10. However I have found that the code competion window in the spyder editor is too small.  This is indepdnent of the font size used in the editor. See enclosed image. 

![codecompletion](https://user-images.githubusercontent.com/1054990/34748546-f0408c6c-f551-11e7-92a4-ca49b8896c83.png)
**What steps will reproduce the problem?**

1. Launch spyder in high res screen.
2. Import numpy as np
3. Type np. and hit tab to bring up code competion window in editor

**What is the expected output? What do you see instead?**
Output should be a bigger code competion window.

**Please provide any additional information below**
I migth be useful to have preference options to change the size of the code competion window.

## Versions and main components
Spyder 3.2.3 on latest Windows 10
* Spyder Version:
* Python Version:
* Qt Version:
* PyQt Version:
* Operating system:


## Dependencies

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:

IPython >=4.0;<6.0:  5.5.0 (OK)
cython >=0.21     :  None (NOK)
jedi >=0.9.0      :  0.11.0 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
numpy >=1.7       :  1.13.3 (OK)
pandas >=0.13.1   :  0.20.3 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pyflakes >=0.5.0  :  1.6.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
pylint >=0.25     :  1.7.4 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
rope >=0.9.4      :  0.10.7 (OK)
sphinx >=0.6.6    :  1.6.4 (OK)
sympy >=0.7.3     :  1.1.1 (OK)



Discussion:
Thanks for reporting. We'll fix this in 3.2.7
@dalthviz, please work on this one. The widget should have a minimal size and it should expand according to font size.
Just checking, @hsauro do you enabled the auto high DPI scaling?:

![imagen](https://user-images.githubusercontent.com/16781833/40944295-e021469c-6819-11e8-8ffd-138bd8e1987f.png)

This is still a problem as the completion widget is not growing. 

See:

<img width="1126" alt="Screen Shot 2019-11-27 at 20 08 34" src="https://user-images.githubusercontent.com/3627835/69769174-c72f2400-1151-11ea-85ea-773c0ec8089b.png">

This should be a simple fix @dalthviz , so I added it to 4.1
Note: https://forum.qt.io/topic/69978/scaling-widget-according-to-screen-scaling-ratio-in-os/12
I am also facing this problem. When I updated spyder from 3.3 to 4.0, the autocompletion window size is too small. It will not change when I change the font size. The high DPI setting will not solve this issue either.

<img width="608" alt="微信截图_20200107132302" src="https://user-images.githubusercontent.com/42349201/71870511-26b92000-3151-11ea-9517-1a39a9e24daa.png">


Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1434,9 +1434,30 @@ def post_visible_setup(self):
         self.menuBar().raise_()
         self.is_setting_up = False
 
+        # Handle DPI scale changes and show restart message
+        screen = self.window().windowHandle().screen()
+        screen.logicalDotsPerInchChanged.connect(self.show_DPI_change_message)
+
         # Notify that the setup of the mainwindow was finished
         self.sig_setup_finished.emit()
 
+    def show_DPI_change_message(self):
+        """Show message to restart Spyder since the DPI scale changed."""
+        screen = self.window().windowHandle().screen()
+        screen.logicalDotsPerInchChanged.disconnect(
+            self.show_DPI_change_message)
+        QMessageBox.warning(
+            self, _("Warning"),
+            _("A monitor scale change was detected. <br><br>"
+              "Spyder will be restarted to be properly displayed."),
+            QMessageBox.Ok)
+        # Activate HDPI auto-scaling option since is needed for a proper
+        # display when using OS scaling
+        CONF.set('main', 'normal_screen_resolution', False)
+        CONF.set('main', 'high_dpi_scaling', True)
+        CONF.set('main', 'high_dpi_custom_scale_factor', False)
+        self.restart()
+
     def set_window_title(self):
         """Set window title."""
         if DEV is not None:


Test patch: