8000 qt: Merge window closing event handlers · matplotlib/matplotlib@a09ddb8 · GitHub
[go: up one dir, main page]

Skip to content

Commit a09ddb8

Browse files
committed
qt: Merge window closing event handlers
This will technically fix the tests with PySide6 6.5.1, but there are other issues with tool manager, so we won't unpin that.
1 parent 3cff1d7 commit a09ddb8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/matplotlib/backends/backend_qt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,6 @@ class FigureManagerQT(FigureManagerBase):
522522
def __init__(self, canvas, num):
523523
self.window = MainWindow()
524524
super().__init__(canvas, num)
525-
self.window.closing.connect(
526-
# The lambda prevents the event from being immediately gc'd.
527-
lambda: CloseEvent("close_event", self.canvas)._process())
528525
self.window.closing.connect(self._widgetclosed)
529526

530527
if sys.platform != "darwin":
@@ -569,6 +566,7 @@ def full_screen_toggle(self):
569566
self.window.showFullScreen()
570567

571568
def _widgetclosed(self):
569+
CloseEvent("close_event", self.canvas)._process()
572570
if self.window._destroying:
573571
return
574572
self.window._destroying = True

0 commit comments

Comments
 (0)
0