def METHOD_NAME(self, filename=None):
    """Grab one frame."""
    if not self.recording and not filename:
        return
    screen = g.app.gui.qtApp.primaryScreen()
    pm = screen.grabWindow(self.winId)
    if False:
        # don't remove this code - all during dev. the above did
        # not capture the pointer in the image, which is quite
        # typical for screen captures - this code draws a pointer
        # in the right place, and may be need to be enabled by a
        #@verbatim
        # @setting in future, if pointer capture does not occur in
        # all environments - pointer is captured in
        # Leo Log Window
        # Leo 4.11 devel, build 5727, 2013-04-19 10:16:15
        # Python 2.7.4, qt version 4.8.4
        # linux2
        # Xubuntu Xfce4 desktop
        cursor = self.widget.cursor()
        pos = self.widget.mapFromGlobal(cursor.pos())
        painter = QtGui.QPainter()
        painter.begin(pm)
        painter.drawImage(
            pos,
            self.pointer_img,
        )
        painter.end()
    if not filename:
        filename = "/tmp/image%04d.bmp" % self.frame
        # save .bmp in video mode because .png is too slow
    pm.save(filename)
    self.frame += 1