Skip to content

Commit 242e5a1

Browse files
committed
address PR comments
1 parent 6dd411c commit 242e5a1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Sources/GtkBackend/GtkBackend.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ public final class GtkBackend: AppBackend {
961961
gtkGesture = GestureClick()
962962
case .secondary:
963963
gtkGesture = GestureClick()
964-
gtk_gesture_single_set_button(gtkGesture.opaquePointer, 3)
964+
gtk_gesture_single_set_button(gtkGesture.opaquePointer, guint(GDK_BUTTON_SECONDARY))
965965
case .longPress:
966966
gtkGesture = GestureLongPress()
967967
}
@@ -978,7 +978,8 @@ public final class GtkBackend: AppBackend {
978978
case .primary:
979979
let gesture =
980980
tapGestureTarget.eventControllers.first {
981-
$0 is GestureClick && gtk_gesture_single_get_button($0.opaquePointer) == 1
981+
$0 is GestureClick
982+
&& gtk_gesture_single_get_button($0.opaquePointer) == GDK_BUTTON_PRIMARY
982983
} as! GestureClick
983984
gesture.pressed = { _, nPress, _, _ in
984985
guard nPress == 1 else {
@@ -989,7 +990,9 @@ public final class GtkBackend: AppBackend {
989990
case .secondary:
990991
let gesture =
991992
tapGestureTarget.eventControllers.first {
992-
$0 is GestureClick && gtk_gesture_single_get_button($0.opaquePointer) == 3
993+
$0 is GestureClick
994+
&& gtk_gesture_single_get_button($0.opaquePointer)
995+
== GDK_BUTTON_SECONDARY
993996
} as! GestureClick
994997
gesture.pressed = { _, nPress, _, _ in
995998
guard nPress == 1 else {

Sources/SwiftCrossUI/Backend/AppBackend.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -814,11 +814,12 @@ extension AppBackend {
814814
todo()
815815
}
816816

817-
public func createTapGestureTarget(wrapping child: Widget) -> Widget {
817+
public func createTapGestureTarget(wrapping child: Widget, gesture: TapGesture) -> Widget {
818818
todo()
819819
}
820820
public func updateTapGestureTarget(
821821
_ clickTarget: Widget,
822+
gesture: TapGesture,
822823
action: @escaping () -> Void
823824
) {
824825
todo()

0 commit comments

Comments
 (0)