Skip to content

Commit

Permalink
fix: fixed stolen focus when activating window within the current wor…
Browse files Browse the repository at this point in the history
…kspace
  • Loading branch information
wojciech-kulik committed Jan 21, 2025
1 parent 1bca433 commit 43da4d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions FlashSpace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"FlashSpace/Preview Content\"";
DEVELOPMENT_TEAM = ZL6756Q8Q2;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -388,7 +388,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 0.1.1;
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = pl.wojciechkulik.FlashSpace.dev;
PRODUCT_NAME = "$(TARGET_NAME)-Dev";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -405,7 +405,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"FlashSpace/Preview Content\"";
DEVELOPMENT_TEAM = ZL6756Q8Q2;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -420,7 +420,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 0.1.1;
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = pl.wojciechkulik.FlashSpace;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
6 changes: 5 additions & 1 deletion FlashSpace/Core/FocusedWindowTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ final class FocusedWindowTracker {

print("Found workspace for app: \(workspace.name)")

AppDependencies.shared.workspaceManager.activateWorkspace(workspace)
let workspaceManager = AppDependencies.shared.workspaceManager

if workspaceManager.activeWorkspace?.id != workspace.id {
workspaceManager.activateWorkspace(workspace)
}
}
}
4 changes: 4 additions & 0 deletions FlashSpace/Core/WorkspaceManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import AppKit
import Combine

final class WorkspaceManager {
private(set) var activeWorkspace: Workspace?

private var cancellables = Set<AnyCancellable>()
private let hideAgainSubject = PassthroughSubject<Workspace, Never>()

Expand All @@ -27,6 +29,8 @@ final class WorkspaceManager {
print("\n\nWORKSPACE: \(workspace.name)")
print("----")

activeWorkspace = workspace

let focusedWindowTracker = AppDependencies.shared.focusedWindowTracker
focusedWindowTracker.stopTracking()
defer {
Expand Down

0 comments on commit 43da4d0

Please sign in to comment.