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

Window.setFrame causes flickering if done quickly after screen changes #296

Open
metakirby5 opened this issue Mar 10, 2022 · 1 comment
Open

Comments

@metakirby5
Copy link
Contributor

  • Version: 12.2.1
  • macOS: 3.0.0

After upgrading to 3.0.0, I noticed that doing Window.setFrame quickly after the screen changes, e.g. via Space.moveWindows or Window.setScreen causes the window to flicker in its old screen before assuming its final position. I'm not sure how fast "quickly" exactly is, but around 0.15 seconds after the screen changes is when the flickering no longer occurs on my machine (tested by deferring the setFrame call with Timer.after).

I looked in the source code and found that setFrame does the following:

- (BOOL) setFrame:(CGRect)frame {

    [self setSize:frame.size];
    [self setTopLeft:frame.origin];
    [self setSize:frame.size];

    return CGRectEqualToRect([self frame], frame);
}

I tried simulating setFrame with a different set of calls to achieve the same effect, and it seems to solve the issue:

function setFrame(window, frame) {
  window.setTopLeft(frame);
  window.setSize(frame);
  window.setTopLeft(frame);
}
metakirby5 added a commit to metakirby5/.dots that referenced this issue Mar 10, 2022
@kasper
Copy link
Owner

kasper commented Mar 10, 2022

@metakirby5 Thanks for the report, I will look into this!

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

2 participants