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 42a646f

Browse filesBrowse files
committed
Fix _FigureManagerGTK.resize on GTK4
Using the same method as __init__ to avoid the deprecated-in-GTK3 and removed-in-GTK4 API. Closes #24015
1 parent 6fb17d9 commit 42a646f
Copy full SHA for 42a646f

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/backends/_backend_gtk.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/_backend_gtk.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ def resize(self, width, height):
233233
width = int(width / self.canvas.device_pixel_ratio)
234234
height = int(height / self.canvas.device_pixel_ratio)
235235
if self.toolbar:
236-
toolbar_size = self.toolbar.size_request()
237-
height += toolbar_size.height
236+
min_size, nat_size = self.toolbar.get_preferred_size()
237+
height += nat_size.height
238238
canvas_size = self.canvas.get_allocation()
239239
if self._gtk_ver >= 4 or canvas_size.width == canvas_size.height == 1:
240240
# A canvas size of (1, 1) cannot exist in most cases, because

0 commit comments

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