Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Fix custom keybind modal opening when keybind property is changed + Improve accessibility access handling #558

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
A88E83C52B37B354009D332F /* CGEvent+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A88E83C42B37B354009D332F /* CGEvent+Extensions.swift */; };
A89307312BAE6D0100566AEE /* CustomWindowActionUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = A89307302BAE6D0100566AEE /* CustomWindowActionUnit.swift */; };
A893D3642BD3299000063510 /* IconConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = A893D3632BD3299000063510 /* IconConfiguration.swift */; };
A89E608F2C932F7000A05AD5 /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A89E608E2C932F7000A05AD5 /* Luminare */; };
A8A1C51E2BD3705A00515A14 /* PaddingConfigurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8A1C51D2BD3705A00515A14 /* PaddingConfigurationView.swift */; };
A8A1C5212BD4863B00515A14 /* KeybindingsConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8A1C5202BD4863B00515A14 /* KeybindingsConfiguration.swift */; };
A8A2ABE72A3FB0370067B5A9 /* KeybindMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8A2ABE62A3FB0370067B5A9 /* KeybindMonitor.swift */; };
Expand All @@ -87,7 +88,6 @@
A8F0125B2AEDD7660017307F /* WindowAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F0125A2AEDD7660017307F /* WindowAction.swift */; };
A8F1E9662C253F5B00AAF871 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A8F1E9652C253F5B00AAF871 /* Localizable.xcstrings */; };
A8F1E9692C253F8D00AAF871 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A8F1E9672C253F8D00AAF871 /* InfoPlist.strings */; };
A8F404A02C82F69700C80DCC /* Luminare in Frameworks */ = {isa = PBXBuildFile; productRef = A8F4049F2C82F69700C80DCC /* Luminare */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -198,7 +198,7 @@
buildActionMask = 2147483647;
files = (
A8DCC97B2980D5F500D41065 /* Defaults in Frameworks */,
A8F404A02C82F69700C80DCC /* Luminare in Frameworks */,
A89E60922C939BEB00A05AD5 /* Luminare in Frameworks */,
A883642F298B7288005D6C19 /* ServiceManagement.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -484,7 +484,7 @@
name = Loop;
packageProductDependencies = (
A8DCC97A2980D5F500D41065 /* Defaults */,
A8F4049F2C82F69700C80DCC /* Luminare */,
A89E60912C939BEB00A05AD5 /* Luminare */,
);
productName = WindowManager;
productReference = A8E59C35297F5E9A0064D4BA /* Loop.app */;
Expand Down Expand Up @@ -527,7 +527,7 @@
mainGroup = A8E59C2C297F5E9A0064D4BA;
packageReferences = (
A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */,
A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */,
A89E60902C939BEB00A05AD5 /* XCRemoteSwiftPackageReference "Luminare" */,
);
productRefGroup = A8E59C36297F5E9A0064D4BA /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -894,17 +894,17 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */ = {
A89E60902C939BEB00A05AD5 /* XCRemoteSwiftPackageReference "Luminare" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/Defaults";
repositoryURL = "https://github.com/MrKai77/Luminare";
requirement = {
branch = main;
kind = branch;
};
};
A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */ = {
A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/MrKai77/Luminare";
repositoryURL = "https://github.com/sindresorhus/Defaults";
requirement = {
branch = main;
kind = branch;
Expand All @@ -913,16 +913,16 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
A89E60912C939BEB00A05AD5 /* Luminare */ = {
isa = XCSwiftPackageProductDependency;
package = A89E60902C939BEB00A05AD5 /* XCRemoteSwiftPackageReference "Luminare" */;
productName = Luminare;
};
A8DCC97A2980D5F500D41065 /* Defaults */ = {
isa = XCSwiftPackageProductDependency;
package = A8DCC9792980D5F500D41065 /* XCRemoteSwiftPackageReference "Defaults" */;
productName = Defaults;
};
A8F4049F2C82F69700C80DCC /* Luminare */ = {
isa = XCSwiftPackageProductDependency;
package = A8F4049E2C82F69700C80DCC /* XCRemoteSwiftPackageReference "Luminare" */;
productName = Luminare;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = A8E59C2D297F5E9A0064D4BA /* Project object */;
Expand Down
16 changes: 8 additions & 8 deletions Loop/Luminare/Settings/Keybindings/KeybindingItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ struct KeybindingItemView: View {
HStack {
HStack {
label()
.onChange(of: keybind) { _ in
if keybind.direction == .custom {
isConfiguringCustom = true
}
if keybind.direction == .cycle {
isConfiguringCycle = true
}
}

HStack {
if keybind.direction == .custom {
Expand Down Expand Up @@ -160,6 +152,14 @@ struct KeybindingItemView: View {
.onChange(of: isPresented) { _ in
searchText = ""
}
.onChange(of: keybind.direction) { _ in
if keybind.direction == .custom {
isConfiguringCustom = true
}
if keybind.direction == .cycle {
isConfiguringCycle = true
}
}
}

func label() -> some View {
Expand Down
6 changes: 6 additions & 0 deletions Loop/Managers/PermissionsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class AccessibilityManager {
if AccessibilityManager.getStatus() {
return true
}
resetAccessibility() // In case Loop is actually in the list, but the signature is different

let alert = NSAlert()
alert.messageText = .init(
localized: .init(
Expand All @@ -42,4 +44,8 @@ class AccessibilityManager {

return status
}

private static func resetAccessibility() {
_ = try? Process.run(URL(filePath: "/usr/bin/tccutil"), arguments: ["reset", "Accessibility", Bundle.main.bundleID])
}
}
Loading