GestureProtocol
public protocol GestureProtocol : EventControllerProtocol
GtkGesture
is the base object for gesture recognition, although this
object is quite generalized to serve as a base for multi-touch gestures,
it is suitable to implement single-touch and pointer-based gestures (using
the special nil
GdkEventSequence
value for these).
The number of touches that a GtkGesture
need to be recognized is controlled
by the GtkGesture:n-points
property, if a gesture is keeping track of less
or more than that number of sequences, it won’t check wether the gesture
is recognized.
As soon as the gesture has the expected number of touches, the gesture will
run the GtkGesture::check
signal regularly on input events until the gesture
is recognized, the criteria to consider a gesture as “recognized” is left to
GtkGesture
subclasses.
A recognized gesture will then emit the following signals:
GtkGesture::begin
when the gesture is recognized.- A number of
GtkGesture::update
, whenever an input event is processed. GtkGesture::end
when the gesture is no longer recognized.
Event propagation
In order to receive events, a gesture needs to either set a propagation phase
through gtk_event_controller_set_propagation_phase()
, or feed those manually
through gtk_event_controller_handle_event()
.
In the capture phase, events are propagated from the toplevel down to the target widget, and gestures that are attached to containers above the widget get a chance to interact with the event before it reaches the target.
After the capture phase, GTK+ emits the traditional GtkWidget::button-press-event
,
GtkWidget::button-release-event
, GtkWidget::touch-event
, etc signals. Gestures
with the GTK_PHASE_TARGET
phase are fed events from the default GtkWidget::event
handlers.
In the bubble phase, events are propagated up from the target widget to the toplevel, and gestures that are attached to containers above the widget get a chance to interact with events that have not been handled yet.
States of a sequence #
Whenever input interaction happens, a single event may trigger a cascade of
GtkGestures
, both across the parents of the widget receiving the event and
in parallel within an individual widget. It is a responsibility of the
widgets using those gestures to set the state of touch sequences accordingly
in order to enable cooperation of gestures around the GdkEventSequences
triggering those.
Within a widget, gestures can be grouped through gtk_gesture_group()
,
grouped gestures synchronize the state of sequences, so calling
gtk_gesture_set_sequence_state()
on one will effectively propagate
the state throughout the group.
By default, all sequences start out in the GTK_EVENT_SEQUENCE_NONE
state,
sequences in this state trigger the gesture event handler, but event
propagation will continue unstopped by gestures.
If a sequence enters into the GTK_EVENT_SEQUENCE_DENIED
state, the gesture
group will effectively ignore the sequence, letting events go unstopped
through the gesture, but the “slot” will still remain occupied while
the touch is active.
If a sequence enters in the GTK_EVENT_SEQUENCE_CLAIMED
state, the gesture
group will grab all interaction on the sequence, by:
- Setting the same sequence to
GTK_EVENT_SEQUENCE_DENIED
on every other gesture group within the widget, and every gesture on parent widgets in the propagation chain. - calling
GtkGesture::cancel
on every gesture in widgets underneath in the propagation chain. - Stopping event propagation after the gesture group handles the event.
Note: if a sequence is set early to GTK_EVENT_SEQUENCE_CLAIMED
on
GDK_TOUCH_BEGIN
/GDK_BUTTON_PRESS
(so those events are captured before
reaching the event widget, this implies GTK_PHASE_CAPTURE
), one similar
event will emulated if the sequence changes to GTK_EVENT_SEQUENCE_DENIED
.
This way event coherence is preserved before event propagation is unstopped
again.
Sequence states can’t be changed freely, see gtk_gesture_set_sequence_state()
to know about the possible lifetimes of a GdkEventSequence
.
Touchpad gestures
On the platforms that support it, GtkGesture
will handle transparently
touchpad gesture events. The only precautions users of GtkGesture
should do
to enable this support are:
- Enabling
GDK_TOUCHPAD_GESTURE_MASK
on theirGdkWindows
- If the gesture has
GTK_PHASE_NONE
, ensuring events of typeGDK_TOUCHPAD_SWIPE
andGDK_TOUCHPAD_PINCH
are handled by theGtkGesture
The GestureProtocol
protocol exposes the methods and properties of an underlying GtkGesture
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Gesture
.
Alternatively, use GestureRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkGesture
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
gesture_ptr
Default implementationTyped pointer to the underlying
GtkGesture
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGesture
instance.Declaration
Swift
var gesture_ptr: UnsafeMutablePointer<GtkGesture>! { get }
-
Required Initialiser for types conforming to
GestureProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GesturePropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: GesturePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Gesture property
Declaration
Swift
@inlinable func get(property: GesturePropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Gesture property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: GesturePropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
GestureSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
GestureSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onBegin(flags:
Extension methodhandler: ) This signal is emitted when the gesture is recognized. This means the number of touch sequences matches
GtkGesture:n-points
, and theGtkGesture::check
handler(s)
returnedTRUE
.Note: These conditions may also happen when an extra touch (eg. a third touch on a 2-touches gesture) is lifted, in that situation
sequence
won’t pertain to the current set of active touches, so don’t rely on this being true.Note
This represents the underlyingbegin
signalDeclaration
Swift
@discardableResult @inlinable func onBegin(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ sequence: Gdk.EventSequenceRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
sequence
the
GdkEventSequence
that made the gesture to be recognizedhandler
The signal handler to call Run the given callback whenever the
begin
signal is emitted -
beginSignal
Extension methodTyped
begin
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var beginSignal: GestureSignalName { get }
-
onCancel(flags:
Extension methodhandler: ) This signal is emitted whenever a sequence is cancelled. This usually happens on active touches when
gtk_event_controller_reset()
is called ongesture
(manually, due to grabs…), or the individualsequence
was claimed by parent widgets’ controllers (seegtk_gesture_set_sequence_state()
).gesture
must forget everything aboutsequence
as a reaction to this signal.Note
This represents the underlyingcancel
signalDeclaration
Swift
@discardableResult @inlinable func onCancel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ sequence: Gdk.EventSequenceRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
sequence
the
GdkEventSequence
that was cancelledhandler
The signal handler to call Run the given callback whenever the
cancel
signal is emitted -
cancelSignal
Extension methodTyped
cancel
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var cancelSignal: GestureSignalName { get }
-
onEnd(flags:
Extension methodhandler: ) This signal is emitted when
gesture
either stopped recognizing the event sequences as something to be handled (theGtkGesture::check
handler returnedfalse
), or the number of touch sequences became higher or lower thanGtkGesture:n-points
.Note:
sequence
might not pertain to the group of sequences that were previously triggering recognition ongesture
(ie. a just pressed touch sequence that exceedsGtkGesture:n-points
). This situation may be detected by checking throughgtk_gesture_handles_sequence()
.Note
This represents the underlyingend
signalDeclaration
Swift
@discardableResult @inlinable func onEnd(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ sequence: Gdk.EventSequenceRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
sequence
the
GdkEventSequence
that made gesture recognition to finishhandler
The signal handler to call Run the given callback whenever the
end
signal is emitted -
endSignal
Extension methodTyped
end
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var endSignal: GestureSignalName { get }
-
onSequenceStateChanged(flags:
Extension methodhandler: ) This signal is emitted whenever a sequence state changes. See
gtk_gesture_set_sequence_state()
to know more about the expectable sequence lifetimes.Note
This represents the underlyingsequence-state-changed
signalDeclaration
Swift
@discardableResult @inlinable func onSequenceStateChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ sequence: Gdk.EventSequenceRef?, _ state: EventSequenceState) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
sequence
the
GdkEventSequence
that was cancelledstate
the new sequence state
handler
The signal handler to call Run the given callback whenever the
sequenceStateChanged
signal is emitted -
sequenceStateChangedSignal
Extension methodTyped
sequence-state-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var sequenceStateChangedSignal: GestureSignalName { get }
-
onUpdate(flags:
Extension methodhandler: ) This signal is emitted whenever an event is handled while the gesture is recognized.
sequence
is guaranteed to pertain to the set of active touches.Note
This represents the underlyingupdate
signalDeclaration
Swift
@discardableResult @inlinable func onUpdate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ sequence: Gdk.EventSequenceRef?) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
sequence
the
GdkEventSequence
that was updatedhandler
The signal handler to call Run the given callback whenever the
update
signal is emitted -
updateSignal
Extension methodTyped
update
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var updateSignal: GestureSignalName { get }
-
onNotifyNPoints(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::n-points
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyNPoints(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyNPoints
signal is emitted -
notifyNPointsSignal
Extension methodTyped
notify::n-points
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNPointsSignal: GestureSignalName { get }
-
onNotifyWindow(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::window
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyWindow(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyWindow
signal is emitted -
notifyWindowSignal
Extension methodTyped
notify::window
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyWindowSignal: GestureSignalName { get }
-
getBoundingBox(rect:
Extension method) If there are touch sequences being currently handled by
gesture
, this function returnstrue
and fills inrect
with the bounding box containing all active touches. Otherwise,false
will be returned.Note: This function will yield unexpected results on touchpad gestures. Since there is no correlation between physical and pixel distances, these will look as if constrained in an infinitely small area,
rect
width and height will thus be 0 regardless of the number of touchpoints.Declaration
Swift
@inlinable func getBoundingBox<RectangleT>(rect: RectangleT) -> Bool where RectangleT : RectangleProtocol
-
getBoundingBoxCenter(x:
Extension methody: ) If there are touch sequences being currently handled by
gesture
, this function returnstrue
and fills inx
andy
with the center of the bounding box containing all active touches. Otherwise,false
will be returned.Declaration
Swift
@inlinable func getBoundingBoxCenter(x: UnsafeMutablePointer<gdouble>!, y: UnsafeMutablePointer<gdouble>!) -> Bool
-
getDevice()
Extension methodReturns the master
GdkDevice
that is currently operating ongesture
, ornil
if the gesture is not being interacted.Declaration
Swift
@inlinable func getDevice() -> Gdk.DeviceRef!
-
getGroup()
Extension methodReturns all gestures in the group of
gesture
Declaration
Swift
@inlinable func getGroup() -> GLib.ListRef!
-
getLastEvent(sequence:
Extension method) Returns the last event that was processed for
sequence
.Note that the returned pointer is only valid as long as the
sequence
is still interpreted by thegesture
. If in doubt, you should make a copy of the event.Declaration
Swift
@inlinable func getLastEvent(sequence: Gdk.EventSequenceRef? = nil) -> Gdk.EventRef!
-
getLastEvent(sequence:
Extension method) Returns the last event that was processed for
sequence
.Note that the returned pointer is only valid as long as the
sequence
is still interpreted by thegesture
. If in doubt, you should make a copy of the event.Declaration
Swift
@inlinable func getLastEvent<EventSequenceT>(sequence: EventSequenceT?) -> Gdk.EventRef! where EventSequenceT : EventSequenceProtocol
-
getLastUpdatedSequence()
Extension methodReturns the
GdkEventSequence
that was last updated ongesture
.Declaration
Swift
@inlinable func getLastUpdatedSequence() -> Gdk.EventSequenceRef!
-
getPoint(sequence:
Extension methodx: y: ) If
sequence
is currently being interpreted bygesture
, this function returnstrue
and fills inx
andy
with the last coordinates stored for that event sequence. The coordinates are always relative to the widget allocation.Declaration
Swift
@inlinable func getPoint(sequence: Gdk.EventSequenceRef? = nil, x: UnsafeMutablePointer<gdouble>! = nil, y: UnsafeMutablePointer<gdouble>! = nil) -> Bool
-
getPoint(sequence:
Extension methodx: y: ) If
sequence
is currently being interpreted bygesture
, this function returnstrue
and fills inx
andy
with the last coordinates stored for that event sequence. The coordinates are always relative to the widget allocation.Declaration
Swift
@inlinable func getPoint<EventSequenceT>(sequence: EventSequenceT?, x: UnsafeMutablePointer<gdouble>! = nil, y: UnsafeMutablePointer<gdouble>! = nil) -> Bool where EventSequenceT : EventSequenceProtocol
-
getSequenceState(sequence:
Extension method) Returns the
sequence
state, as seen bygesture
.Declaration
Swift
@inlinable func getSequenceState<EventSequenceT>(sequence: EventSequenceT) -> GtkEventSequenceState where EventSequenceT : EventSequenceProtocol
-
getSequences()
Extension methodReturns the list of
GdkEventSequences
currently being interpreted bygesture
.Declaration
Swift
@inlinable func getSequences() -> GLib.ListRef!
-
getWindow()
Extension methodReturns the user-defined window that receives the events handled by
gesture
. Seegtk_gesture_set_window()
for more information.Declaration
Swift
@inlinable func getWindow() -> Gdk.WindowRef!
-
getGroup(gesture:
Extension method) Adds
gesture
to the same group thangroup_gesture
. Gestures are by default isolated in their own groups.When gestures are grouped, the state of
GdkEventSequences
is kept in sync for all of those, so callinggtk_gesture_set_sequence_state()
, on one will transfer the same value to the others.Groups also perform an “implicit grabbing” of sequences, if a
GdkEventSequence
state is set toGTK_EVENT_SEQUENCE_CLAIMED
on one group, every other gesture group attached to the sameGtkWidget
will switch the state for that sequence toGTK_EVENT_SEQUENCE_DENIED
.Declaration
Swift
@inlinable func getGroup<GestureT>(gesture: GestureT) where GestureT : GestureProtocol
-
handles(sequence:
Extension method) Returns
true
ifgesture
is currently handling events corresponding tosequence
.Declaration
Swift
@inlinable func handles(sequence: Gdk.EventSequenceRef? = nil) -> Bool
-
handles(sequence:
Extension method) Returns
true
ifgesture
is currently handling events corresponding tosequence
.Declaration
Swift
@inlinable func handles<EventSequenceT>(sequence: EventSequenceT?) -> Bool where EventSequenceT : EventSequenceProtocol
-
isGroupedWith(other:
Extension method) Returns
true
if both gestures pertain to the same group.Declaration
Swift
@inlinable func isGroupedWith<GestureT>(other: GestureT) -> Bool where GestureT : GestureProtocol
-
setSequenceState(sequence:
Extension methodstate: ) Sets the state of
sequence
ingesture
. Sequences start in stateGTK_EVENT_SEQUENCE_NONE
, and whenever they change state, they can never go back to that state. Likewise, sequences in stateGTK_EVENT_SEQUENCE_DENIED
cannot turn back to a not denied state. With these rules, the lifetime of an event sequence is constrained to the next four:- None
- None → Denied
- None → Claimed
- None → Claimed → Denied
Note: Due to event handling ordering, it may be unsafe to set the state on another gesture within a
GtkGesture::begin
signal handler, as the callback might be executed before the other gesture knows about the sequence. A safe way to perform this could be:static void first_gesture_begin_cb (GtkGesture *first_gesture, GdkEventSequence *sequence, gpointer user_data) { gtk_gesture_set_sequence_state (first_gesture, sequence, GTK_EVENT_SEQUENCE_CLAIMED); gtk_gesture_set_sequence_state (second_gesture, sequence, GTK_EVENT_SEQUENCE_DENIED); } static void second_gesture_begin_cb (GtkGesture *second_gesture, GdkEventSequence *sequence, gpointer user_data) { if (gtk_gesture_get_sequence_state (first_gesture, sequence) == GTK_EVENT_SEQUENCE_CLAIMED) gtk_gesture_set_sequence_state (second_gesture, sequence, GTK_EVENT_SEQUENCE_DENIED); }
If both gestures are in the same group, just set the state on the gesture emitting the event, the sequence will be already be initialized to the group’s global state when the second gesture processes the event.
Declaration
Swift
@inlinable func setSequenceState<EventSequenceT>(sequence: EventSequenceT, state: GtkEventSequenceState) -> Bool where EventSequenceT : EventSequenceProtocol
-
set(state:
Extension method) Sets the state of all sequences that
gesture
is currently interacting with. Seegtk_gesture_set_sequence_state()
for more details on sequence states.Declaration
Swift
@inlinable func set(state: GtkEventSequenceState) -> Bool
-
set(window:
Extension method) -
set(window:
Extension method) Sets a specific window to receive events about, so
gesture
will effectively handle only events targetingwindow
, or a child of it.window
must pertain togtk_event_controller_get_widget()
.Declaration
Swift
@inlinable func set<WindowT>(window: WindowT?) where WindowT : WindowProtocol
-
ungroup()
Extension methodSeparates
gesture
into an isolated group.Declaration
Swift
@inlinable func ungroup()
-
device
Extension methodReturns the master
GdkDevice
that is currently operating ongesture
, ornil
if the gesture is not being interacted.Declaration
Swift
@inlinable var device: Gdk.DeviceRef! { get }
-
group
Extension methodReturns all gestures in the group of
gesture
Declaration
Swift
@inlinable var group: GLib.ListRef! { get }
-
isActive
Extension methodReturns
true
if the gesture is currently active. A gesture is active meanwhile there are touch sequences interacting with it.Declaration
Swift
@inlinable var isActive: Bool { get }
-
isRecognized
Extension methodReturns
true
if the gesture is currently recognized. A gesture is recognized if there are as many interacting touch sequences as required bygesture
, andGtkGesture::check
returnedtrue
for the sequences being currently interpreted.Declaration
Swift
@inlinable var isRecognized: Bool { get }
-
lastUpdatedSequence
Extension methodReturns the
GdkEventSequence
that was last updated ongesture
.Declaration
Swift
@inlinable var lastUpdatedSequence: Gdk.EventSequenceRef! { get }
-
sequences
Extension methodReturns the list of
GdkEventSequences
currently being interpreted bygesture
.Declaration
Swift
@inlinable var sequences: GLib.ListRef! { get }
-
window
Extension methodIf non-
nil
, the gesture will only listen for events that happen on thisGdkWindow
, or a child of it.Declaration
Swift
@inlinable var window: Gdk.WindowRef! { get nonmutating set }