Closed ShlomoCode closed 1 week ago
Lets focus on finder - if you right click the finder icon and hit "new finder window" and then hover over it again, it doesnt show up?
It's weird - it does work now for Finder (for VSCode and Calendar not yet). Probably for Finder this is some edge case, I will try to understand how to exactly reproduce the problem.
Are you positive vscode and calendar have active windows open? Apps can be "active" without any windows being open - hence the confusion. Or its possible their windows are in another desktop space, which isnt supported yet.
Are you positive vscode and calendar have active windows open?
Yes of course. I made a screen recording for a demonstration where you can see that a preview does not appear for an open VSCode window, while for other applications (for example iTerm) it does:
https://github.com/ejbills/DockDoor/assets/78599753/b7f78c50-0a24-401b-85c0-c9593ca55c51
For you it shows for VSCode?
It wasn't showing vscode for me either, I fixed it. Will be in next release.
Great. This should also fix Apple Calendar?
Yes, my calendar previews are working on my laptop. If the issue is still there once the update is released, just ping me here and we can repoen this ticket.
If you'd like to push the fix commit I can confirm if it does fix the problem (I'm actually currently running a local DockDoor build I built using XCode, with Ctrl + Tab functionality disabled).
Just pushed to main, give it a try and let me know!
Now works for open VSCode window, but not for minimized VSCode. For Calendar does not work at all, not even if it is open
https://github.com/ejbills/DockDoor/assets/78599753/02e45934-368b-4c92-9bc8-8b928c844d3f
OK, I think I know the issue. I think it's the app name matching, it looks like your system applications are using a different language so the window can't find the match.
Can you please add this to line 257 of WindowUtil.swift print("Owning application: (app.applicationName)") print("Searching for: (applicationName)")
and hover over calendar, let me know what it says?
Looks like you're right! And when I change back the language of Calendar (in System Settings > Language & Region > Applications) to "System Default - English" the preview works.
This happens because macOS does not apply the localization to the title in the Dock and Launchpad when the language is changed only for the application and not for the entire system, but it does change the window title...
Can you print out the applicationName.localizedLowercase var? I'm hoping that will match the window name.
I switched my locale to hebrew, and calendar previews appear to be working for me...
Yes, when the application and the system are the same, there is no problem, because both the window title and the name in the Dock are translated and identical. The problem is caused when the system is in one language, and a specific language is selected for the application (this is a built-in option of macOS). For example, an English system, and the Hebrew language was selected for the calendar app. In this case, the name in the Dock remains in its English version but the window title is the translated version, thus creating a mismatch:
Can you print out the applicationName.localizedLowercase var? I'm hoping that will match the window name.
I think I fixed it, please try the latest commit on main.
Yes, it works!
Thank you for your help!
About this, we can get the bundle url directly using NSWorkspace.shared.urlForApplication
:
func getNonLocalizedAppName(forBundleIdentifier bundleIdentifier: String) -> String? {
guard let bundleURL = NSWorkspace.shared.urlForApplication(withBundleIdentifier: bundleIdentifier) else {
return nil
}
let bundle = Bundle(url: bundleURL)
// ....
let nonLocalName = getNonLocalizedAppName(forBundleIdentifier: app.bundleIdentifier)
This seems to me more clean than going through NSRunningApplication.runningApplications
> tempApp
> tempApp.bundleURL
.
If you want I can also make a PR.
Yes, that would be great!
When I hover over the Dock icon of these applications nothing happens. Version 1.0.5, macOS 14.5