Skip to content

Commit 8c9d96f

Browse files
committed
removed now unecessary old code
1 parent d5bf60b commit 8c9d96f

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

Sources/GtkBackend/GtkBackend.swift

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,6 @@ public final class GtkBackend: AppBackend {
6464
private var sheetContexts: [OpaquePointer: SheetContext] = [:]
6565
private var connectedCloseHandlers: Set<OpaquePointer> = []
6666

67-
/* // C-convention thunk for key-pressed
68-
private let escapeKeyPressedThunk:
69-
@convention(c) (
70-
UnsafeMutableRawPointer?, guint, guint, GdkModifierType, gpointer?
71-
) -> gboolean = { controller, keyval, keycode, state, userData in
72-
// TRUE (1) = consume event
73-
if keyval == GDK_KEY_Escape {
74-
guard let userData else { return 1 }
75-
let box = Unmanaged<ValueBox<() -> Void>>.fromOpaque(userData).takeUnretainedValue()
76-
box.value()
77-
return 1
78-
}
79-
return 0
80-
}
81-
*/
8267
// A separate initializer to satisfy ``AppBackend``'s requirements.
8368
public convenience init() {
8469
self.init(appIdentifier: nil)
@@ -1633,27 +1618,6 @@ public final class GtkBackend: AppBackend {
16331618
return 1
16341619
}
16351620

1636-
/* let escapeHandler = gtk_event_controller_key_new()
1637-
gtk_event_controller_set_propagation_phase(escapeHandler, GTK_PHASE_BUBBLE)
1638-
g_signal_connect_data(
1639-
UnsafeMutableRawPointer(escapeHandler),
1640-
"key-pressed",
1641-
unsafeBitCast(escapeKeyPressedThunk, to: GCallback.self),
1642-
Unmanaged.passRetained(
1643-
ValueBox(value: {
1644-
if ctx.interactiveDismissDisabled { return }
1645-
self.runInMainThread {
1646-
ctx.onDismiss()
1647-
}
1648-
})
1649-
).toOpaque(),
1650-
{ data, _ in
1651-
if let data {
1652-
Unmanaged<ValueBox<() -> Void>>.fromOpaque(data).release()
1653-
}
1654-
},
1655-
.init(0)
1656-
)*/
16571621
sheet.setEscapeKeyPressedHandler {
16581622
print("escapeKeyPressed")
16591623
if ctx.interactiveDismissDisabled { return }

0 commit comments

Comments
 (0)