def _ungrab_mouse(self, x=None, y=None):
if not self.is_attached_to_gui:<EOL><INDENT>return<EOL><DEDENT>if self.is_root:<EOL><INDENT>if (x, y) != (None, None):<EOL><INDENT>self.dispatch_event('<STR_LIT>', x, y, <NUM_LIT:0>, <NUM_LIT:0>)<EOL><DEDENT>return<EOL><DEDENT>if self.parent.__mouse_grabber is self:<EOL><INDENT>self.parent.__mouse_grabber = None<EOL>self.parent._ungrab_mouse(x, y)<EOL><DEDENT>
Release the mouse and allow mouse events to be handled as usual again.

If ``x`` and ``y`` coordinates are provided, an ``on_mouse_motion`` 
event will be triggered by the root widget.  In some circumstances, 
this is necessary to get widgets to re-evaluate their appearance (e.g.  
rollover state) after the mouse is released.

It is not an error to call this method if the widget is not actually 
grabbing the mouse, it just won't do anything.