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 will flash-resize with different resolution monitors on workspace switch #149

Closed
tale opened this issue Feb 4, 2024 · 13 comments
Closed
Labels
problem Neither a bug, nor a feature request

Comments

@tale
Copy link

tale commented Feb 4, 2024

Refer to the video below, but whenever I switch workspaces, you can see that the window focuses and then expands to fit the bottom of the screen. I think I've figured out what the issue is in the way AeroSpace handles its virtual spaces. It's a combination of 2 different issues:

  • When focusing a workspace, it appears that the window first gets maximized off-screen and then moved into focus.
  • Windows by default will go to the bottom right when you focus away from their workspace.

Below, I've also shown my display configuration from settings, and I think the problem is because the display on the right is smaller than the primary display on the left, when I focus a workspace, it'll maximize the window to the size of the smaller display, move it to the bigger display, and then resize it again to fit the bigger display.

macOS Version: 14.3
Keyboard Layout: QWERTY
Config: https://github.com/tale/dotfiles/blob/main/config/bash/aerospace.toml
Aerospace Version:

aerospace CLI client version: 0.8.3-Beta bf02074c6aad434701809471fffdc7756e69d17e
AeroSpace.app server version: 0.8.3-Beta bf02074c6aad434701809471fffdc7756e69d17e
CleanShot.2024-02-04.at.14.42.58.2.mp4

CleanShot 2024-02-04 at 14 50 30


Duplicated by: #219 #235

@nikitabobko
Copy link
Owner

Yeah, I recently realized that we have this problem too. Thanks for the report!

When focusing a workspace, it appears that the window first gets maximized off-screen and then moved into focus.

Unfortunately, this is needed, otherwise, in some cases, macOS goes crazy and doesn't set sizes that I said it to set #143

Windows by default will go to the bottom right when you focus away from their workspace.

AeroSpace could be more intelligent here and try to find spots where it could hide windows on the current monitor. For example in your monitor configuration, it could hide windows this way:

1

But not all monitor configurations will be possible to support

2

@nikitabobko
Copy link
Owner

My current advice (workaround) is to set up your monitor layout to make your right monitor the main monitor.

This way, the monitor you interact the most doesn't have this flickering

@tale
Copy link
Author

tale commented Feb 6, 2024

Thanks for the suggestion, maybe the workaround could be an option to specify hiding windows per monitor or just a better mechanism to give more control for that. I don't dock much, but my physical laptop display is to the right which is why the layout was like that. I'd also be open to contribute on this if there's a potential solution you may have in mind. I know Swift pretty well.

@tale
Copy link
Author

tale commented Feb 6, 2024

Is there any way to resize it bigger than that display actually? So for example, if we know ahead of time it's going to the 1920x1080p monitor, make it sized for that?

@lukasesch
Copy link

I am facing the same 'issue' and the flickering on my main screen is really distracting.
Sadly I cant use my right screen as my main screen, as it'd involve rearrange my whole desk and their mounted screens.
My 4k main screen is in the middle and the secondary WQHD screen on the right.

Is there any option to make windows move into the left corner, so they'd stay on the main screen?
I know I then have the flicker on my secondary screen to the right, but that'd be okay for me. :)

Thanks for your hard work and would be great to see a fix / options here!

@ryanflegel
Copy link

ryanflegel commented Jun 11, 2024

This issue is also causing an issue with Microsoft Teams. When the window is resized downwards, the conversation scroll position doesn't remain at the bottom and essentially scrolls up the difference between the two monitor heights.

This is clearly an issue with Teams, since I'm able to reproduce the issue with AeroSpace disabled and resizing manually, but leaving a comment here in case others come across it.

@gempir
Copy link

gempir commented Jul 1, 2024

I found a small hack around it, if your right monitor is your mac built-in display then you can change the resolution to match your main monitor as close as possible (In my case 1440p)

It will make everything on your built-in screen tiny and hard to read, but you can zoom in in some apps.

resize flicker is gone on the main screen though.

image

@Kamyil
Copy link

Kamyil commented Jul 2, 2024

This issue is really weird. I have both work and home setup
Home setup: MacBook screen on the bottom left & 4k monitor (LG HDR 4K 30') downscaled to 1920x1080 in the center
Zrzut ekranu 2024-07-2 o 10 07 42
Work setup: MacBook on the bottom right and 1920x1080 (iiyama ProLite 24' E2483HSU) native screen in the center

and home setup does not have this problem at all, while work setup on the other hand does resize apps on every workspace switch. It's pretty distracting and I don't seem to get why does it work properly on home setup and not on the work one
I've tried the workaround mentioned above

"My current advice (workaround) is to set up your monitor layout to make your right monitor the main monitor."
but it doesn't seem to work for me

EDIT: I've tried to swap the screens on work setup and it has fixed the issue for me. So for some weird reason this happens only when I have MacBook screen on the right lol

@gohma231
Copy link

My current advice (workaround) is to set up your monitor layout to make your right monitor the main monitor.

This way, the monitor you interact the most doesn't have this flickering

Is it possible to...

  1. Specify the monitor that is used to 'hide' windows? ('hide' meaning moved to the bottom corner). Or....
  2. Specify which corner the windows are moved to? Options such as 'bottom left' or 'bottom right' would work.

My mac display is my second monitor. Due to some workplace constraints, moving it to the left is more difficult than it should be...

@v2kovac
Copy link

v2kovac commented Aug 1, 2024

My current advice (workaround) is to set up your monitor layout to make your right monitor the main monitor.
This way, the monitor you interact the most doesn't have this flickering

Is it possible to...

  1. Specify the monitor that is used to 'hide' windows? ('hide' meaning moved to the bottom corner). Or....
  2. Specify which corner the windows are moved to? Options such as 'bottom left' or 'bottom right' would work.

My mac display is my second monitor. Due to some workplace constraints, moving it to the left is more difficult than it should be...

lol i fixed this by just re-arranging my displays to have the mac laptop screen on the left, but I still have it physically on the right and this app enables mouse wrap around so it still feels the same: https://download.cnet.com/download/wraparound/3000-18487_4-32085.html

@Kamyil
Copy link

Kamyil commented Aug 1, 2024

I think the potential solution here (not sure but in theory it should work) could be some config option that would allow user to define -> which corner of display Aerospace should hide windows in

Then apps should not run rescaling if for example - they were placed in bottom-left corner and I would workspace-switch on my main screen which is placed on the left side

@nikitabobko
Copy link
Owner

could be some config option that would allow user to define -> which corner of display Aerospace should hide windows in

No, the right solution is already described here #149 (comment)

nikitabobko added a commit that referenced this issue Aug 3, 2024
_fixes #149

If the monitor configuration is correct, this commit _fixes
#289

I accidentally managed to reduce number of visible pixels to a single
1-pixel vertial line, so it paritally _fixes
#66
nikitabobko added a commit that referenced this issue Aug 3, 2024
_fixes #149

If the monitor configuration is correct, this commit _fixes
#289

I accidentally managed to reduce number of visible pixels to a single
1-pixel vertial line, so it paritally _fixes
#66
@nikitabobko
Copy link
Owner

nikitabobko commented Aug 3, 2024

Should be fixed since 0.14.0

Now, AeroSpace keeps windows on their respective monitors when hidden, without moving them to the bottom-right monitor

jakenvac pushed a commit to jakenvac/AeroSpace that referenced this issue Aug 16, 2024
_fixes nikitabobko#149

If the monitor configuration is correct, this commit _fixes
nikitabobko#289

I accidentally managed to reduce number of visible pixels to a single
1-pixel vertial line, so it paritally _fixes
nikitabobko#66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Neither a bug, nor a feature request
Projects
None yet
Development

No branches or pull requests

8 participants