Gdk.Event does not strip the boolean result functions when called on base struct instance
Submitted by Simon Feltman
Link to original bug (#736381)
Description
The problem is we patch method of Gdk.Event onto its union structs with a stripped boolean result (get_state, get_axis, get_coords, get_root_coords). But we do not do this for the primary union struct itself leading to an inconsistent API:
In [1]: from gi.repository import Gdk
In [2]: ev = Gdk.EventButton()
In [3]: ev.type = Gdk.EventType.BUTTON_PRESS
In [4]: ev.get_coords()
Out[4]: (0.0, 0.0)
In [5]: ev = Gdk.Event.new(Gdk.EventType.BUTTON_PRESS)
In [6]: ev.get_coords()
Out[6]: (True, 0.0, 0.0)
The former Gdk.EventButton() is the struct used when passed to event callbacks.
Edited by Christoph Reiter