Skip to content

Commit

Permalink
safer potential match, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ejbills committed Jun 26, 2024
1 parent 34c6076 commit 3fb6a84
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions DockDoor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.5;
CURRENT_PROJECT_VERSION = 1.0.6;
DEVELOPMENT_ASSET_PATHS = "\"DockDoor/Preview Content\"";
DEVELOPMENT_TEAM = 2Q775S63Q3;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -447,7 +447,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.0.6;
PRODUCT_BUNDLE_IDENTIFIER = com.ethanbills.DockDoor;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -464,7 +464,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.5;
CURRENT_PROJECT_VERSION = 1.0.6;
DEVELOPMENT_ASSET_PATHS = "\"DockDoor/Preview Content\"";
DEVELOPMENT_TEAM = 2Q775S63Q3;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -479,7 +479,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.0.6;
PRODUCT_BUNDLE_IDENTIFIER = com.ethanbills.DockDoor;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
Binary file not shown.
10 changes: 8 additions & 2 deletions DockDoor/Utilities/WindowUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,16 @@ struct WindowUtil {
}

/// Closes a window using its close button.
static func closeWindow(closeButton: AXUIElement) {
static func closeWindow(closeButton: AXUIElement?) {
guard let closeButton = closeButton else {
print("Error: closeButton is nil.")
return
}

let closeResult = AXUIElementPerformAction(closeButton, kAXPressAction as CFString)
if closeResult != .success {
print("Error closing window: \(closeResult.rawValue)")
return
}
}

Expand Down Expand Up @@ -263,7 +269,7 @@ struct WindowUtil {
let nonLocalName = getNonLocalizedAppName(for: tempApp){

// Collect potential matches
if applicationName.contains(app.applicationName) {
if applicationName.contains(app.applicationName) || app.applicationName.contains(applicationName) {
potentialMatches.append(app)
}

Expand Down

0 comments on commit 3fb6a84

Please sign in to comment.