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 are not center aligned, sometimes #352

Closed
ngocphamm opened this issue May 22, 2020 · 5 comments
Closed

Windows are not center aligned, sometimes #352

ngocphamm opened this issue May 22, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@ngocphamm
Copy link

Describe the bug

Windows are not centered, but only somtimes, like after I have some windows/apps opened (maybe with their weird sizes?)

Screenshots / video

Screen Shot 2020-05-22 at 3 53 23 PM

Steps to reproduce the bug

Not sure... Just open AltTab window I guess...

@ngocphamm ngocphamm added the bug Something isn't working label May 22, 2020
@lwouis
Copy link
Owner

lwouis commented May 23, 2020

Hey @ngocphamm :)

This looks like a layout bug. The layout code is around 50 lines of code but it's pretty tricky to follow and easy to make off-by-1-px calculations which completely ruin the layout.

Is it happening all the time, or is it just with specific combination of windows sizes? I haven't used centered alignment in a while so not sure if this issue has been going on for a while or not

@ngocphamm
Copy link
Author

This is happening only with a certain combination of windows, of various sizes I have not been able to figure out the pattern yet.

@ngocphamm
Copy link
Author

And also I noticed the font for the window title sometimes is different for 1 or more windows 🤔

Screen Shot 2020-05-23 at 10 53 21 AM

@lwouis
Copy link
Owner

lwouis commented May 23, 2020

@ngocphamm i remember fixing that issue a long time ago with a workaround. I then removed it as it seemed no longer necessary after I rewrote the whole layout for performance. How is this stuff still bugging? sigh macOS...

I guess I'll put the workaround back. It's so frustrating that I don't see this happen locally. Also why does it happen sometimes and not others. It has to be a bug in AppKit's NSTextView. The font object is initiated once, in the constructor I set font to the right value. There is no code changing the font after that...

@lwouis
Copy link
Owner

lwouis commented May 25, 2020

For the windows not being aligned, I think I found the issue. It happens only in center-aligned layout, and when you have preferences set to hide some windows (like from other spaces, or minimized, etc).

I fixed it, and it will be released soon 👍

@lwouis lwouis closed this as completed in e25dcd2 May 25, 2020
lwouis pushed a commit that referenced this issue May 25, 2020
# [4.0.0](v3.24.1...v4.0.0) (2020-05-25)

### Bug Fixes

* center-aligned layout was sometimes broken (closes [#352](#352)) ([e25dcd2](e25dcd2))
* crash in some rare scenarios with lots of windows ([a859347](a859347))
* potentially fix shortcuts not working sometimes ([8d833f5](8d833f5))
* rework all multi-threading to handle complex scenarios ([d144476](d144476)), closes [#348](#348) [#157](#157) [#342](#342) [#93](#93)
* sometimes windows titles use the wrong font ([fa1095e](fa1095e))
* update japanese localization ([acef0b2](acef0b2))

### BREAKING CHANGES

* this rework should fix all sorts of issues when OS events happen in parallel: new windows, new apps, user shortcuts, etc. Here are example of use-cases that should work great now, without, and very quickly:

* AltTab is open and an app/window is launched/quit
* A window is minimized/deminimized, and while the animation is playing, the user invokes AltTab
* An app starts and takes a long time to boot (e.g. Gimp)
* An app becomes unresponsive, yet AltTab is unaffected and remains interactive while still processing the state of the window while its parent app finally stops being frozen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants