Skip to content

Commit 930fdcf

Browse files
Try #8082
1 parent 972b8a8 commit 930fdcf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

mne/viz/_brain/_brain.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,20 @@ def ensure_minimum_sizes(self):
656656
yield
657657
finally:
658658
self.splitter.setSizes([sz[1], mpl_h])
659+
# 1. Process events
659660
_process_events(self.plotter)
660661
_process_events(self.plotter)
661-
self.mpl_canvas.canvas.setMinimumSize(0, 0)
662+
# 2. Get the window size that accommodates the size
663+
sz = self.plotter.app_window.size()
664+
# 3. Call app_window.setBaseSize and resize (in pyvistaqt)
665+
self.plotter.window_size = (sz.width(), sz.height())
666+
# 4. Undo the min size setting and process events
667+
self.plotter.interactor.setMinimumSize(0, 0)
668+
_process_events(self.plotter)
669+
_process_events(self.plotter)
670+
# 5. Resize the window (again!) to the correct size
671+
# (not sure why, but this is required on macOS at least)
672+
self.plotter.window_size = (sz.width(), sz.height())
662673
_process_events(self.plotter)
663674
_process_events(self.plotter)
664675
# sizes could change, update views

0 commit comments

Comments
 (0)