Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows get moved to other monitors after waking up from sleep #1167

Open
rdamazio opened this issue Nov 20, 2021 · 10 comments
Open

Windows get moved to other monitors after waking up from sleep #1167

rdamazio opened this issue Nov 20, 2021 · 10 comments

Comments

@rdamazio
Copy link

rdamazio commented Nov 20, 2021

Describe the bug
After waking up from sleep, some windows are on a different monitor than they were before.

Applications:
Chrome, Finder

To Reproduce
Steps to reproduce the behavior:

  • Use a Mac with 3 monitors (haven't tried with less)
  • Sample arrangement: 2 windows in Tall split mode on the center monitor, nothing on the other two (or a Finder window or the right)
  • Let Mac go to sleep
  • Wake up from sleep

Expected behavior
2 windows would still be on the center monitor

Screenshots
Before sleep - center:
BEFORE CENTER - Screen Shot 2021-11-20 at 13 37 35

Before sleep - right:
BEFORE RIGHT - Screen Shot 2021-11-20 at 13 37 35 (3)

After sleep - center:

AFTER CENTER - Screen Shot 2021-11-20 at 13 37 43

After sleep - right:

AFTER RIGHT - Screen Shot 2021-11-20 at 13 37 43 (3)

Versions:

  • macOS: 12.0.1
  • Amethyst: 0.15.5 (92)

Debug Info

$ /Applications/Amethyst.app/Contents/MacOS/Amethyst --debug-info
Version: 0.15.5 (92)

OS version: Version 12.0.1 (Build 21A559)

Screens:
	(0.0, 0.0, 3840.0, 2160.0) [(0.0, 0.0, 3840.0, 2160.0)]
	(-3200.0, 506.0, 3200.0, 1800.0) [(-3200.0, -146.0, 3200.0, 1800.0)]
	(3840.0, 458.0, 2560.0, 1440.0) [(3840.0, 262.0, 2560.0, 1440.0)]

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

Additional context
iMac Pro 2018, built-in monitor on the left, 2 other external monitors as center and right.
Most times, only 1 window gets moved to the right monitor, but there have been a few cases where all of them did.
This started a few days ago, possibly when the last update was pushed out?

@dbaynard
Copy link

I started to see this immediately after upgrading to monterey, on 0.15.3 and 0.15.5.

@rdamazio
Copy link
Author

rdamazio commented Jan 24, 2022

I've narrowed this down a bit more - it's always the second window (even if there are more than 2) in each workspace of my 2nd monitor that gets moved from that workspace into the first workspace of my 3rd monitor.
(where "2nd monitor" is the one from 0 to 3840 width, 3rd is the one starting at 3840)

@dbaynard
Copy link

I have been tracking this, too, for the past week. My second monitor is set as the extended display.

I find every chrome window (on second monitor) gets moved to the active workspace on the first monitor. However, the chrome app I have open doesn’t get moved. On one or two occasions, the app moved, not the chrome windows, but I haven’t been able to reproduce it.

When I unlock my mac, it always switches the second monitor workspace to the first available (this pre-dates the monterey upgrade). I just assumed this was macos being opinionated; it’s plausible that there’s something in amethyst that is mucking with second windows.

When I realized it only affected a single application, I started to suspect an off-by-one error somewhere. I don’t understand enough to know why the layout is changing anyway on unlock.

@dwink
Copy link

dwink commented Feb 11, 2022

I have this same issue -- I only have two monitors, and I suspect what's happening is that when the system sleeps, it moves the windows to the primary monitor (the one where the "menu bar" is) and then when it wakes up they all just stay there. In my setup, I have a lot of windows full-screen on the smaller monitor and just three on the bigger screen, so I end up needing to push a bunch of windows around to get back to the ideal state.

I just set the smaller monitor to be the primary; I'll report back and see if that helps, but a way to somehow restore layouts on demand would me amazing :)

@dbaynard
Copy link

If we don’t fix the issue, at least there’s now a support group.

I did encounter something similar with xmonad (on linux) — on restart, all windows would be assigned to the same (first) workspace. With Amethyst, though, restarts are fine, for me.

@rdamazio
Copy link
Author

FYI still happening on 0.15.6.

@acidghost
Copy link

This has been happening to me too with 2 external monitors, one of which is the main display. After unlocking the screen, windows from seemingly random desktops get moved to the active desktop on the main display. I'll update if I see a more deterministic pattern.

@mo-st
Copy link

mo-st commented Jun 9, 2022

I have the same issue with 3 monitors.
When only locking for a short time the windows stay in place but after a couple of minutes when the system sleeps they're all in the wrong place. I would also like to add that at least for me this seems to happen with all programs, so far I've seen it happen to: VS Code, Firefox, Skim, Finder and iTerm2

Things I tried that don't work:

  • Disabling separate spaces for each monitor in the system mission control preferences
  • Changing the main display (this changes where the windows end up after unlocking but no fix)
  • Waiting on the lock screen for all displays to wake up before unlock

Non-solution/ workaround

  • You can enable "Prevent your Mac from automatically sleeping when the display is off" in System pref > Battery > Power Adapter and then just lock the screen instead of sleeping. As far as I tried there is no way for the system to sleep or even be shut down without jumbling up the order. At least this way you can lock it and quickly get back into working if you just take a short break.

@efrancis
Copy link

efrancis commented Mar 9, 2023

I've had the same problem on my computer with 2 external LG screens. It seems they had the exact same identifier so MacOS could not distinguish which is which when waking up. I exchanged one LG screen against a monitor of a different brand, which promptly fixed the problem.

@mo-st
Copy link

mo-st commented Jun 7, 2023

Interesting, don't think this is the problem in my case though. The two external monitors are HP and LG with different resolution. This issue is still present in 0.19.0 btw, just to be clear. Sorry I can't help, sadly I don't speak Swift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants