Skip to content

Commit 2e70254

Browse files
authored
Merge pull request #22936 from greglucas/macosx-window-fullscreen
ENH: Add full-screen toggle to the macosx backend
2 parents d1f6b76 + 530890f commit 2e70254

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/_macosx.m

+10
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,13 @@ static CGFloat _get_device_scale(CGContextRef cr)
713713
Py_RETURN_NONE;
714714
}
715715

716+
static PyObject*
717+
FigureManager_full_screen_toggle(FigureManager* self)
718+
{
719+
[self->window toggleFullScreen: nil];
720+
Py_RETURN_NONE;
721+
}
722+
716723
static PyTypeObject FigureManagerType = {
717724
PyVarObject_HEAD_INIT(NULL, 0)
718725
.tp_name = "_macosx.FigureManager",
@@ -746,6 +753,9 @@ static CGFloat _get_device_scale(CGContextRef cr)
746753
{"resize",
747754
(PyCFunction)FigureManager_resize,
748755
METH_VARARGS},
756+
{"full_screen_toggle",
757+
(PyCFunction)FigureManager_full_screen_toggle,
758+
METH_NOARGS},
749759
{} // sentinel
750760
},
751761
};

0 commit comments

Comments
 (0)