From eb85f93a9eb59110ac9d249bb3ab4e2ea4ca1480 Mon Sep 17 00:00:00 2001 From: david-swift Date: Sun, 31 Mar 2024 13:00:03 +0200 Subject: [PATCH] Simplify focused modifier --- Sources/Adwaita/View/Modifiers/InspectorWrapper.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Adwaita/View/Modifiers/InspectorWrapper.swift b/Sources/Adwaita/View/Modifiers/InspectorWrapper.swift index 6198dfe..419db36 100644 --- a/Sources/Adwaita/View/Modifiers/InspectorWrapper.swift +++ b/Sources/Adwaita/View/Modifiers/InspectorWrapper.swift @@ -160,7 +160,7 @@ extension View { focused.wrappedValue = newValue } } - if focused.wrappedValue != (gtk_event_controller_focus_contains_focus(controller.pointer) != 0) { + if gtk_event_controller_focus_contains_focus(controller.pointer) == 0, focused.wrappedValue { gtk_widget_grab_focus(storage.pointer?.cast()) } }