Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6c1991d

Browse filesBrowse files
committed
Use wrapper to set max DPI awareness in MSW in wx backend
1 parent 268392f commit 6c1991d
Copy full SHA for 6c1991d

File tree

Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-5
lines changed

‎lib/matplotlib/backends/backend_wx.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_wx.py
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TimerBase, ToolContainerBase, cursors,
2222
CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent)
2323

24-
from matplotlib import _api, cbook, backend_tools
24+
from matplotlib import _api, cbook, backend_tools, _c_internal_utils
2525
from matplotlib._pylab_helpers import Gcf
2626
from matplotlib.path import Path
2727
from matplotlib.transforms import Affine2D
@@ -43,10 +43,8 @@ def _create_wxapp():
4343
wxapp = wx.App(False)
4444
wxapp.SetExitOnFrameDelete(True)
4545
cbook._setup_new_guiapp()
46-
if wx.Platform == '__WXMSW__':
47-
# Set per-process DPI awareness. See https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/ne-shellscalingapi-process_dpi_awareness
48-
import ctypes
49-
ctypes.windll.shcore.SetProcessDpiAwareness(2)
46+
# Set per-process DPI awareness. This is a NoOp except in MSW
47+
_c_internal_utils.Win32_SetProcessDpiAwareness_max()
5048
return wxapp
5149

5250

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.