steventheworker / DockAltTab

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

Previews now in the centre of the screen #6

Closed My-Name-Is-Adam closed 1 year ago

My-Name-Is-Adam commented 1 year ago

Hi there,

Not sure if what's changed but I needed to reinstall the OS, before the previews were appearing just above the dock (think of the Windows taskbar).

Now they're appearing in the centre of the screen.

Is there any way I can change this or was it a previous version that did this? I prefer it down the bottom as we've now got to drag the mouse to the middle of the screen to select the window which isn't ideal if there are a few windows for the same application open.

Thank you.

steventheworker commented 1 year ago

(version 2.0) = first version with AppleScript, all previews in default AltTab location (centered) (>= v2.1) = previews above/beside the dock & issue #4 was introduced (previews stuck on bottom left) (>= v2.4) = issue #4 "patch" (if previews stuck, fallback to default AltTab location (centered))

Issue #4 seems to be caused by bad permissions (enough Accessibility granted to use Automation, but not enough to read UI sizes (dock, UI elements)). Also can be caused by having unchecked entries in Security & Privacy.

https://user-images.githubusercontent.com/43100895/199863993-f93d1a68-4852-4c57-8845-73ff5300d8c0.mp4

Give it accessibility + input monitoring, then it'll ask for automation (note: it may ask for the downloads folder if it's on your dock and you click it). Sometimes it helps if you install it after removing the current entries from "security & privacy" and then trying after a reboot.

sdburrows commented 1 year ago

Hi there,

I have the same problem as the above poster. On my original installation on MacBook Pro 14, the preview shows up above the dock. But on my other new MacBook Air, the preview is showing up in the middle of the screen. I have gone through the process of deleting the app, clearing the permission within Privacy and reinstalling and granting permission. The result is the same.

I suspect this could be due to Ventura. On my MacBook Pro 14, I installed in on Monterey and then upgraded to Ventura, no problem. But on my new MacBook Air, it's a clean install of Ventura and it just wouldn't work.

I even tried rolling back to older version (all the way back to v2.0) but no avail. Please look into this as I find this app to be quite useful in Mac's lack of windows management!

Many thanks, Steven

steventheworker commented 1 year ago

Don't know for sure, but It's likely not Ventura being the factory OS that's causing this. The steps below work on my Ventura VM (but was upgraded from Monterey & only got ~30gb so I'd have to delete it to check).

I'm thinking it could be because v2.4 & v2.5 are unnotarized (need to bypass gatekeeper). These use a different set of permissions (than the notarized 2.0-2.3). Permissions need to be re-added if you want to switch to a un/notarized version (or vice-versa).

  1. Remove permissions w/ tccutil reset All com.steventheworker.DockAltTab
  2. Trash DockAltTab & empty trash
  3. Open Spotlight and search for DockAltTab. Restart macOS if no copies are found.
  4. Redownload the latest version (v2.5 download)
  5. Place into applications
  6. Open DockAltTab
  7. Accept the 1st prompt for Input Monitoring & make sure it's checked in Settings.
  8. Accept the 2nd prompt for Accessibility & make sure it's checked in Settings.
sdburrows commented 1 year ago

Hi,

I followed every steps and upon reinstallation it did asked me for Input Monitoring and Accessibility access. I enabled both:

Screenshot 2022-11-16 at 21 40 51

Screenshot 2022-11-16 at 21 41 01

And the preview is still in the middle of the screen :(

Screenshot 2022-11-16 at 21 48 25

steventheworker commented 1 year ago

Just realized on step 1 I added an extra dot at the end. (my last comment was edited) it should not be tccutil reset All com.steventheworker.DockAltTab. the correct command is tccutil reset All com.steventheworker.DockAltTab

Can you retry and see if it works? The extra dot meant permissions didn't get removed at all.

sdburrows commented 1 year ago

I actually did removed the "." at the end when typing the command into the Terminal.

steventheworker commented 1 year ago

I had someone saying tccutil did nothing for them. Does it remove the permissions for you or do they remain? "Automation" seems to have given them trouble, since you can't reset it without tccutil.

And how many monitors do you use?

sdburrows commented 1 year ago

It definitely got removed from the Privacy tab. When I reinstalled the app, the app asked for access again and I had to manually toggle them on.

I have one external monitor, the MacBook is docked in clamshell mode the whole time.

briandpetersonOG commented 1 year ago

Maybe it is a Mac OS update? I got one and now it's doing the centered thing. I have Ventura on a M1 Mac Book Pro 16". I did all the resets above. It was working on this mac great the other day.

briandpetersonOG commented 1 year ago

I looked at the code, and started playing with the dock position in system settings. After going to the left, then right (in between restart DockAltTab) it eventually shook it loose. No idea. But worth a shot. I don't feel like really isolating the steps. But it is working for me right now!

steventheworker commented 1 year ago

Did you restart macOS in between it not working/working?

briandpetersonOG commented 1 year ago

Not mac os. Just the app

sdburrows commented 1 year ago

I am not tech savvy. I tried many restarts of both Mac and the app (DockAltTab and AltTab), the preview is still in the middle of the screen :(

steventheworker commented 1 year ago

You don't have to restart AltTab, since the issue is DockAltTab. You can run these scriptable AltTab commands to make sure it's working properly though.

DockAltTab is responsible for sending the commands. And this release will show you the values it uses to calculate x & y (in preferences). It'd be helpful to know which of these values is missing.

steventheworker commented 1 year ago

Also just pointing out, in issue #4, two others seemed to think messing with their monitor setup resolved this issue for them.

briandpetersonOG commented 1 year ago

In my case I had no external monitor. I looked at the code a noticed it figures out where the dock is.

So I wondered what would happen if I put the dock to the right or left. So I did that and restarted both apps. All of a sudden it started to work (properly above the dock).

My issue persisted reboots. I am unsure why moving the dock to the left/right and back to the bottom fixed it. But it did.

sdburrows commented 1 year ago

@briandpetersonOG: I did what you suggested. Move the dock to the left, close both apps and reopen the preview is showing up on the left. Then I moved the dock back to the bottom and I got this:

Screenshot 2022-11-21 at 21 11 40

Then, I closed DockAltTab and reopen. It is fixed. :)

steventheworker commented 1 year ago

Curious if this is the first time you've changed your dock positions before? Or perhaps you reset your dock preferences via terminal and never changed it. Hoping this might actually be the cause of the bug...

Edit: Looks like this is probably the cause. defaults delete com.apple.dock "orientation" let me reproduce the centered previews bug! Fixing ASAP

@briandpetersonOG thanks so much, this bug getting fixed is a dream come true. 🤩

briandpetersonOG commented 1 year ago

For me I might have reset dock preferences. I was playing with udock