Skip to content

Commit 530890f

Browse files
committed
ENH: Add full-screen toggle to the macosx backend
1 parent 1a016f0 commit 530890f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/_macosx.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,13 @@ static CGFloat _get_device_scale(CGContextRef cr)
684684
Py_RETURN_NONE;
685685
}
686686

687+
static PyObject*
688+
FigureManager_full_screen_toggle(FigureManager* self)
689+
{
690+
[self->window toggleFullScreen: nil];
691+
Py_RETURN_NONE;
692+
}
693+
687694
static PyTypeObject FigureManagerType = {
688695
PyVarObject_HEAD_INIT(NULL, 0)
689696
.tp_name = "_macosx.FigureManager",
@@ -714,6 +721,9 @@ static CGFloat _get_device_scale(CGContextRef cr)
714721
{"resize",
715722
(PyCFunction)FigureManager_resize,
716723
METH_VARARGS},
724+
{"full_screen_toggle",
725+
(PyCFunction)FigureManager_full_screen_toggle,
726+
METH_NOARGS},
717727
{} // sentinel
718728
},
719729
};

0 commit comments

Comments
 (0)