steventheworker / DockAltTab

Window preview app for MacOS (on the dock) using AltTab.
https://DockAltTab.netlify.app
GNU General Public License v3.0
91 stars 4 forks source link

Multi monitor displays places the previews in the lower left of the screen #4

Closed tdupont750 closed 2 years ago

tdupont750 commented 2 years ago

Unfortunately the app is unusable when the previews are not right above the dock icons. Not sure what additional information to provide.

steventheworker commented 2 years ago

I'm on an m1 air Monterey 12.5 using DockAltTab v2.2 and the latest scriptable AltTab (1.1).

Where are the previews showing from? Sounds like a bug. Maybe it has to do with your AltTab settings. Here's how it's working for me with my settings.

tdupont750 commented 2 years ago

I am also on an M1, but with Monterey 12.3. I tried reinstalling but it still has the same problem. Please let me know if there is any other information that I can provide.

steventheworker commented 2 years ago
  1. Where are the previews showing from? The default AltTab location? Or somewhere else?
  2. Make sure you have no other copies of DockAltTab and AltTab on the hard drive.
  3. If this is from conflict with another app it could be helpful to know which other apps are running.
    • paste this into the terminal to get a list of all running processes
    • osascript -e 'tell application "System Events" to return name of processes'
    • paste the output here, here's mine for comparison
DavidKaub commented 2 years ago

I guess I'm having the same issue running macOS 12.5 on M1. Never used either AltTab nor DockAltTab before. Just reinstalled again with the latest release and the

scriptable AltTab (1.1)

AltTab verison you mentioned above For me, ad 1: Bottom left corner (see picture). This is not the AltTab location. Bildschirmfoto 2022-08-10 um 12 25 19

ad 3: Running osascript -e 'tell application "System Events" to return name of processes' yields:

loginwindow, ViewBridgeAuxiliary, SystemUIServer, ControlCenter, talagent, ViewBridgeAuxiliary, QuickLookUIService, Finder, NotificationCenter, Spotlight, OneDrive, Seafile FinderSync, AppSSOAgent, AirPlayUIAgent, TextInputMenuAgent, WiFiAgent, CoreServicesUIAgent, imklaunchagent, AutoLauncher, Rectangle, UnnaturalScrollWheels, Spotify, TextInputSwitcher, CoreLocationAgent, Keychain Circle Notification, OneDrive File Provider, SoftwareUpdateNotificationManager, Google Chrome, UIKitSystem, familycircled, coreautha, OSDUIHelper, Teams, Microsoft Outlook, Microsoft Teams Helper (Renderer), storeuid, com.apple.WebKit.Networking, com.apple.WebKit.WebContent, PowerChime, studentd, UserNotificationCenter, IsExtensionEnabled, Discord, universalAccessAuthWarn, ThumbnailExtension_macOS, TextEdit, Electron, KeePassXC, com.apple.appkit.xpc.openAndSavePanelService, QuickLookUIService, Seafile FinderSync, Docker, Docker Desktop, com.apple.appkit.xpc.openAndSavePanelService, QuickLookUIService, Seafile FinderSync, Seafile FinderSync, Seafile FinderSync, Seafile FinderSync, Seafile FinderSync, LookupViewService, AlDente, nbagent, System Preferences, AccountProfileRemoteViewService, com.apple.preference.security.remoteservice, AvatarPickerMemojiPicker, AdvertisingExtension, PrivacyPhotos, PrivacyAnalytics, LocalAuthenticationRemoteService, com.apple.appkit.xpc.openAndSavePanelService, QuickLookUIService, Seafile FinderSync, Dock, com.apple.dock.extra, DockHelper, Reminders, Preview, AltTab, DockAltTab, Terminal, System Events, osascript, FolderActionsDispatcher
tdupont750 commented 2 years ago

osascript showed that i was only running one copy of AltTab, and it should have been the scriptable copy not running from Applications

steventheworker commented 2 years ago

So you have the official copy in applications? Because from experience, macOS will cache & run the first version you installed, unless you remove it. In the meantime, you could also use DockAltTab v2.0 which places previews @ the default AltTab location.

tdupont750 commented 2 years ago

I will try removing everything and reinstalling the scriptable version. Forgive me for being a novice Mac user, but any advice on how to ensure that any cached versions have been cleaned up?

steventheworker commented 2 years ago

Well since David is having the same issue and has never had either app installed prior, it could just be a software bug and not a caching issue.

But, just in case: use spotlight to search the app and use command + enter to open it in Finder. If a copy exists, delete it and then empty the trash. Repeat until there's no results in spotlight.

Do you happen to have an international keyboard or macOS set to another language? I thought I'd ask since that used to be an issue, and David had his set to German. I just tested on a virtual machine and changed languages but couldn't reproduce this bug still...

if you want you can also reach me on the DockAltTab & Dock Exposé discord server. Also please try v2.0 and let me know if the location at least changes to AltTab's default placement.

@DavidKaub these are the processes that you're running (that I don't have). I narrowed it down a little and removed apps I thought were unlikely to cause this issue. Maybe you can stop them 1 by 1 to see if DockAltTab starts to work, the most likely would be other apps enabled in System Preferences under Accessibility.

tdupont750 commented 2 years ago

v2.0 worked just fine and placed the previews in the center middle of the screen

DavidKaub commented 2 years ago

I don't know why exactly, but it's working for me now. Things I changed:

  1. Installed v2.0 which worked but as expected the previews ape rared in the middle of the screen
  2. I removed most apps from the Accessibility settings and additionally removed 'Dock Window preview' (which I tried to use before for the exact same purpose but did not work) from the Mac (was listed in the Accessibility also).
  3. Installed v2.2
  4. After it seamed to work, I added all apps except 'Dock Window preview' to the Accessibility settings again, and it still worked.

I do not know if it now works because of the removed apps or because I used v2.0 before or because of any other reason, but I'm very happy with the result. Also, I realized that before, I might have installed an automated update of AltTab immediately after installation of the scripted version because the app suggested it to me.

One more thing I'd like to mention is that when I was able to "fix" the issue, i.e. I reinstalled both the apps etc. my Mac was not connected to an external display. I connected the Mac to the external display only after it worked on the internal - but it still works now!

I hope with these experiences, maybe also @tdupont750 can get it running - and thanks to you @steventheworker for the help!

tdupont750 commented 2 years ago

Launching DockAltTab while the laptop was not connected to multiple monitors worked, and then after adding the monitors everything has continued to work. Should this issue be closed out, or is it still a bug that it does not initialize correctly?

@DavidKaub Thank you for finding the solution!

@steventheworker This app is great, thank you for all of your hard work!

steventheworker commented 2 years ago

So very thankful you guys figured this out! I'm thinking of leaving this issue open so others can find it more easily, since I can't figure out how to reproduce this without reinstalling macOS / buying a whole new laptop. 🤔 But it does sound like this issue is mainly due to a multi-monitor bug.

And yes, the scriptable AltTab may prompt you to update, but it will install the official copy which will mess it all up. I strongly suggest turning off automatic updates under Preferences->Policies. Scriptable AltTab updates have to be installed manually, sadly. This might change in the future when I have more free time to fix the updater.

DOCaCola commented 2 years ago

The issue persists for me with or without the recommended settings. While i have external monitors connected occasionally, i have tried starting this with no monitors attached or even restarting the whole mac with no success.

steventheworker commented 2 years ago

To make sure your scriptable AltTab is working correctly, open the Notes app, and run these 3 commands in a terminal:

  1. Show @ default AltTab position (centered)
    • osascript -e 'tell application "AltTab" to showApp appBID "com.apple.Notes"'
  2. Show @ bottom left
    • osascript -e 'tell application "AltTab" to showApp appBID "com.apple.Notes" x 0 y 0'
  3. Show @ 100px from bottom, 100px from left
    • osascript -e 'tell application "AltTab" to showApp appBID "com.apple.Notes" x 100 y 100'

If these commands don't work, you might have a copy of the official app that's running instead, or the permissions are wrong.

DOCaCola commented 2 years ago

These commands work just fine in my case. The AltTap preview also appears at the given offset.

steventheworker commented 2 years ago

When you hover over dock icons are there no previews at all? Or does it also show at the bottom left like it did for tdupont750 and DavidKaub? Also could be helpful if we chatted on the discord.

DOCaCola commented 2 years ago

Sorry. I should have been clearer. Yes, the previews appear in the bottom left corner when i hover dock items.

Bildschirmfoto 2022-08-27 um 13 29 44
steventheworker commented 2 years ago

Well since they both saw success after using v2.0 to center the previews, could you try installing it, and then reinstalling v2.2. Kind of at a loss with this bug, but from the sound of it, it has to be something to do with the app not reading monitor sizes at the start.

DOCaCola commented 2 years ago

With v2.0 the previews are indeed centered on the screen. When i then upgrade to v2.2 the previews are in the bottom left corner again.

steventheworker commented 2 years ago

Well DockAltTab uses Accessibility to get monitor sizes (as well as mouse coordinates), but since you're getting previews at all, that tells me that Accessibility shouldn't be the issue, but my gut is telling me it's only half working.

Quit the app and you can use tccutil reset All com.steventheworker.DockAltTab to remove all permission entries. Restart, and then try installing one last time (but give permissions before starting DockAltTab). If it still won't work, you can continue using v2.0 until there's an update. Out of ideas for the moment 🫤

DOCaCola commented 2 years ago

Still no luck. Permissions are set correctly, but 2.2 still doesn't work. 2.0 is still working for some reason. I also tried deleting the preference files and caches.

Edit: 2.1 works as well

steventheworker commented 2 years ago

Wait, so, does 2.1 place the previews in the correct position, or is it placed on bottom-left / centered?

DOCaCola commented 2 years ago

Actually, now v2.2 works as well. I do not know what exactly has changed. After downgrading to v2.0 (again), then going to v2.1 and then v2.2 for some reason the previews are in the correct position now.

steventheworker commented 2 years ago

Ha well that's great to hear. I'm still unsure if this bug was introduced between v2.0-v2.1, or v2.1-v2.2. Could also be that monitor sizes weren't being read consistently in all versions, but it's only noticeable in the last two versions (since those variables are finally being used).

For now, seems like trying v2.0/v2.1 or messing with monitors fixes this 🤷‍♀️

cetemadi commented 2 years ago

I've tried the steps above on single an dual monitor setup and issue is still there. Went from version 2.0-2.4

steventheworker commented 2 years ago

@cetemadi I just made a troubleshoot "forum" on the discord to keep from repeating too many comments on this thread.