"Activate Previous Window" not working or working incorrectly

Describe the bug:

The "Activate Previous Window" does not work on macOS Sequoia as intended (compared to the previous macOS version). It works as intended right after the update to the latest alpha version of the app, but stops working after ~10 minutes. App restart helps from time to time. System restart helps for about the same 10 minutes, then stops working.

Strangely, it sometimes activates an "Obsidian" app window (which is on another space) even if the Obsidian was not the previously used app or window. Then, after triggering it again, it does nothing.


Affected input device:

The shortcut is bound to the "4 Finger Swipe Down" on the MacBook Trackpad. The gesture triggers itself correctly, but the action is not.


Device information:

  • Type of Mac: MacBook Pro 14-inch 2021
  • macOS version: Sequoia 15.1
  • BetterTouchTool version: 4.861 (2024110706)

UPD: Regarding the Obsidian trigger, the app seems to be chosen randomly in this case. Sometimes it is the browser.

The action has recently been updated to also work if the previous window was on a different space. However it seems to work fine here.

Can you see any pattern to when this starts behaving erratically? Maybe Obsidian or the browser are being activated by something?

I'm afraid that I'll have to reset the macOS system completely in order to check whether there is any other app interference.

Currently the shortcut is just not triggered at all when I try to perform any linked gestures :frowning:

I am getting this as well, starting maybe a month ago, Mac OS 15.1, all recent versions of BTT including 4.889 (2024112105), minimal other apps running. Adding some detail:

  • Bug can be reliably replicated by having the last active window be a window of the same app (eg, browser window, finder).
  • If the last active window was just minimised, this action restores the window (undesired, change in behaviour to previous version)
  • When broken, no window change occurs but Additional Haptic Feedback of the trigger still happens.
2 Likes

Mac OS 15.0 here, same exact issue for me using BTT 4.973 (2024121018). Explained perfectly.

One thought I had: I have Mac Settings > Desktop & Dock > Mission Control > Displays have separate Spaces = Off, in case this is relevant.

This is probably my most used trigger and I have been missing it a lot over the last couple of months. Fingers crossed it can be addressed.

1 Like

I might not fully understand the issue or the action seems to work fine here. Would you be able to do a quick screen capture to show what’s not working for you?

  • Enabled "Displays have separate Spaces" (back to default value), restarted, no change.
  • Closed as many apps as possible.
  • Ensure latest BTT.
  • Created a new empty BTT preset with only one trigger/action (json below and in recording).
  • Recorded screen demonstrating the two issues, as you can see they can be reliably replicated.
    388.08 MB file on MEGA
    (Minor note, after minimising the calc app, clicking to focus a safari window makes no change to the recorded behaviour.)

[
{
"BTTActionCategory" : 0,
"BTTLastUpdatedAt" : 1734247111.5210309,
"BTTTriggerType" : 0,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTUUID" : "DE52CFF8-AE29-4CAB-BC8E-4830B414A0B2",
"BTTPredefinedActionType" : 366,
"BTTPredefinedActionName" : "Empty Placeholder",
"BTTAdditionalConfiguration" : "0",
"BTTKeyboardShortcutScope" : 0,
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTTriggerOnDown" : 1,
"BTTLayoutIndependentChar" : "SPACE",
"BTTEnabled" : 1,
"BTTEnabled2" : 1,
"BTTShortcutKeyCode" : 49,
"BTTShortcutModifierKeys" : 0,
"BTTOrder" : 0,
"BTTAutoAdaptToKeyboardLayout" : 0,
"BTTAdditionalActions" : [
{
"BTTActionCategory" : 0,
"BTTLastUpdatedAt" : 1734247083.0857081,
"BTTTriggerParentUUID" : "DE52CFF8-AE29-4CAB-BC8E-4830B414A0B2",
"BTTIsPureAction" : true,
"BTTTriggerClass" : "BTTTriggerTypeKeyboardShortcut",
"BTTUUID" : "DC82B4E1-E2F5-4DF7-877F-A017BCDE7209",
"BTTPredefinedActionType" : 383,
"BTTPredefinedActionName" : "Activate Previous Window",
"BTTKeyboardShortcutKeyboardType" : 0,
"BTTEnabled" : 1,
"BTTEnabled2" : 1,
"BTTShortcutKeyCode" : -1,
"BTTOrder" : 182,
"BTTAutoAdaptToKeyboardLayout" : 0
}
],
"BTTTriggerConfig" : {
"BTTHUDText" : "TEST",
"BTTShowHUD" : 1
}
}
]

1 Like

Hi Andreas, have you had a chance to look at my screen recording? If you are not able to replicate this let me know if there is any more information you need. Thanks!

could you check whether this works for you in 5.01 alpha? (uploading now)

Hey, thanks for looking into this. I can confirm this works a little better but it is still quite easy to break. I've spent a while putting together a list of tests to demonstrate in case it is useful.

Note I am expecting the Activate Previous Window action to "activate the most recently-active window that is not minimized" just like Cmd+Tab or Cmd+`. Your specific intention or goal may differ.

Setup

  • Configure a trigger with only the "Activate Previous Window" action.
  • Open the three windows specified (referenced as A, B, C).
  • Before each test, activate window A, then window B, then window C.

From this state, perform any one of the following bullet items.

Finder+Finder+Finder or Safari+Safari+Safari windows:

  • Close or minimize window C (window B is activated), trigger the action. Expected: window A. Actual: no change.
  • Close or minimize window B without activating it (window C is still active), trigger the action. Expected: window A. Actual: no change.
  • Minimize window A without activating it (window C is still active), trigger the action. Expected: window B. Actual: no change.

Finder+Finder+Finder windows:

  • Click the desktop (desktop focused, no window active), trigger the action (window C active), trigger the action again. Expected: focus desktop or window B. Actual: no change.

Safari+Safari+Safari windows:

  • Click the desktop (desktop focused, no window active), trigger the action. Expected: window C. Actual: window B.

Safari+Safari+Finder windows:

  • Minimize window C (no Finder window active), trigger the action. Expected: window B. Actual: window A.

Finder+Finder+Safari windows:

  • Minimize window C (no Safari window active), trigger the action (window B is activated), trigger the action again. Expected: window A is activated. Actual: window C is restored.

I think most of them are expected as BTT treats minimized window still as "previous window" if it was the previous one.

In 5.061 I have added an additional action "Activate Previous Window (Exclude Minimized)”, maybe that works better for you. It uses a completely different way for activating the previous window and will not work across spaces or for minimized windows.

1 Like

Great! The new action works well and solves the main issue for me (I don't use multiple spaces). I'll let others chime in if they have any further concerns.

Specifically the new action works correctly for the first 3 of my tests above. The last 4 tests now fail in a similar way by activating the wrong window, so they may all be the same problem. Not a deal-breaker for me, i'm just happy to get the old functionality back.

Thanks for your work!