ianyh / Amethyst

Automatic tiling window manager for macOS à la xmonad.
https://ianyh.com/amethyst/
MIT License
14.68k stars 487 forks source link

Clicking between 2 chrome windows causes windows to swap position #1495

Open ssisk opened 1 year ago

ssisk commented 1 year ago

hello! I really love Amethyst, thanks so much for making it!

Describe the bug When I have two chrome windows open and I click to change focus between them, the positions of the windows clicked will frequently (but not always) swap in amethyst's layout (eg swap between primary and secondary, or between two positions in secondary)

Applications: I tried repro'ing this with chrome, Terminal, Safari and vs code. It seems to only repro when using two chrome windows.

To Reproduce Steps to reproduce the behavior:

  1. Open two chrome windows
  2. Click in one of the windows, then the other
  3. Repeat a couple times, the bug should repro (usually within 10 clicks or so)

I tried a couple different layout (tall, wide) and it repro'd in all the ones I tried

Expected behavior The positions of the windows should not change, focus should change, but not window positioning

Screenshots n/a

Versions:

Debug Info

Version: 0.19.0 (103)

OS version: Version 12.5 (Build 21G72)

Screens:
        (0.0, 0.0, 1728.0, 1117.0) [(0.0, 0.0, 1728.0, 1117.0)]
        (1728.0, 0.0, 3840.0, 2160.0) [(1728.0, -1043.0, 3840.0, 2160.0)]

Configuration:
mod2: (
    option,
    shift,
    control
)
screen-padding-right: 0
floating: (
        {
        id = "com.tinyspeck.slackmacgap";
        "window-titles" =         (
        );
    },
        {
        id = "com.apple.systempreferences";
        "window-titles" =         (
        );
    },
        {
        id = "us.zoom.xos";
        "window-titles" =         (
        );
    },
        {
        id = "com.apple.Preview";
        "window-titles" =         (
        );
    }
)
mod1: (
    option,
    shift
)
layouts: (
    tall,
    wide,
    fullscreen,
    column,
    floating,
    "middle-wide"
)
ignore-menu-bar: 0
window-minimum-height: 0
new-windows-to-main: 0
window-margins: 0
window-margin-size: 0
screen-padding-left: 0
restore-layouts-on-launch: 1
use-canary-build: 0
window-minimum-width: 0
enables-layout-hud: 1
follow-space-thrown-windows: 1
screen-padding-bottom: 0
float-small-windows: 1
mouse-follows-focus: 0
floating-is-blacklist: 1
debug-layout-info: 0
window-resize-step: 5
screen-padding-top: 0
window-max-count: 0
enables-layout-hud-on-space-change: 1
focus-follows-mouse: 0

Manageable applications:
        Terminal (com.apple.Terminal)
        QuickTime Player (com.apple.QuickTimePlayerX)
        Finder (com.apple.finder)
        Calendar (com.apple.iCal)
        Safari (com.apple.Safari)
        Preview (com.apple.Preview)
        Activity Monitor (com.apple.ActivityMonitor)
        TextEdit (com.apple.TextEdit)
        zoom.us (us.zoom.xos)
        Code (com.microsoft.VSCode)
        Slack (com.tinyspeck.slackmacgap)
        Google Chrome (com.google.Chrome)
        Docker Desktop (com.electron.dockerdesktop)

Additional context Thanks again for working on amethyst!

meluzeanah commented 1 year ago

Hello, I am having very similar issues, very persistent. And I, too, am so happy that there is an app like Amethyst, so I hope this will get fixed as this is the only serious isssue I am dealing with but one that forces me to frequently shut the app completely :(

Set up: I use 3–6 spaces (screens) and typically 2–4 chrome windows split in two on each screen plus a few more applications, each designated to its own space.

The issue is that the Chrome windows occupying the same screen, keep swapping for no reasons. Typically, I find them swapped when I come back from another space (screen). What is more, if I allow only e.g. 2 windows as max count, and I need to move a tab from one window to the other, and as a result, the tab I wish to move is recognized as a third window for a fleeting moment, the second window gets minimized and the first gets the full screen. This is understandable, as only 2 windows are allowed and I wasn’t fast enough to move the tab before it got recognized as a third window, so far so good, what gets buggy is the next bit: So I move the tab back to the first window or close it, so that there is only the one active window and the second one minimized and nothing more. Then I maximize the second window to get it back on the screen but this time, it won’t acquire its dedicated half as before but instead, the Amethyst app stays locked in the fullscreeen (or wide?) layout and no matter how many times I hit the Tall shortcut or try to set the Tall settings from within the menu, it won’t go Tall. Interestingly enough, at this point, the row layout will work but the tall won’t.

To sum it up: if there are two windows in the Tall layout, they keep swapping without any apparent reason and if one of the windows ends up in a fullscreen (or Wide?) mode, I cannot make the two windows go back to the Tall layout. The second one would keep hidden and the first one maxed out.

Versions: Mac OS Ventura 13.4 Chrome 114.0.5735.90 (Official Build) (x86_64) Amethyst: 0.19.0 (103)

Thanks for your efforts and thanks for taking look at this!

ssisk commented 1 year ago

This issue appears to be resolved for me now (clicking back and forth between multiple chrome windows while amethyst is open does not cause windows to change position).

Given that I'm still on the same version of Amethyst, this must have been caused by some interaction with macOs or chrome.

I'm leaving it open since @meluzeanah has raised other issues here, but the issue is resolved for me.

ianyh commented 1 year ago

I think this might be related to how we handle mouse dragging windows. Something like you click on one window, then another, and for whatever reason we think you dragged one over the other. So it resolving may have been performance happenstance.

agmitron commented 9 months ago

Same issue here.

apopovs-figma commented 8 months ago

I've used Amethyst and Chrome for months with no issue, but started experiencing this bug constantly this week, seemingly coinciding with upgrading to Sonoma.

Attaching a video in case it's helpful:

https://github.com/ianyh/Amethyst/assets/132942853/0d8d84ce-83ce-467f-923a-af1bf077c14c

Chrome 120.0.6099.199 (Official Build) (arm64), macOS Version 14.2 (Build 23C64), Amethyst 0.20.0 (108)

mariuspana commented 8 months ago

I have a similar issue with Safari, Mail. It happens when I change virtual desktops. Amethyst version 0.20.0 (108) MacOS Sonoma (M1) 14.3 (23D56)

blackvvine commented 7 months ago

Same issue here

Amethyst 0.20.0 (108) MacOS 14.3.1 (23D60)

BigBrotherJu commented 5 months ago

Same issue here, it's driving me crazy.

Amethyst 0.20.0 (108) MacOS 14.3.1 (23D60)

quaelin commented 4 months ago

Just recently started experiencing this too, clicking between Chrome windows :(