question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sluggish resize on macOS

See original GitHub issue

Avalonia 0.9.999-cibuild0008170-beta macOS Catalina

Resizing a window on macOS is sluggish / laggy. This is even true if the window only contains a single Button.

type MainWindow() =
    inherit Window()
    do
        base.Title <- "Sluggish resize example"
        base.Height <- 400.0
        base.Width <- 400.0
        
        base.Content <- Button ()
        
type App() =
    inherit Application()

    override this.Initialize() =
        this.Styles.Load "resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"
        this.Styles.Load "resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default"

    override this.OnFrameworkInitializationCompleted() =
        match this.ApplicationLifetime with
        | :? IClassicDesktopStyleApplicationLifetime as desktopLifetime ->
            let mainWindow = MainWindow()
            desktopLifetime.MainWindow <- mainWindow
        | _ -> ()

module Program =

    [<EntryPoint>]
    let main(args: string[]) =
        AppBuilder
            .Configure<App>()
            .UsePlatformDetect()
            .UseSkia()
            .StartWithClassicDesktopLifetime(args)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
danwalmsleycommented, Jun 11, 2020

Reproed here… thanks

1reaction
JaggerJocommented, Jun 8, 2020

sure

using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml.Styling;

namespace ConsoleApp1
{

    class MainWindow : Window
    {
        public MainWindow ()
        {
            Title = "Sluggish resize example";
            Width = 400.0;
            Height = 400.0;
            Content = new Button();
        }
    }

    class App : Application
    {
        public override void Initialize()
        {
            var styleA = new StyleInclude(baseUri: null);
            styleA.Source = new Uri("resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default");
            Styles.Add (styleA);
            
            var styleB = new StyleInclude(baseUri: null);
            styleB.Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default");
            Styles.Add (styleB);
        }

        public override void OnFrameworkInitializationCompleted()
        {
            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)
            {
                var mainWindow = new MainWindow();
                desktopLifetime.MainWindow = mainWindow;
            }
        }
    }
    
    class Program
    {
        static void Main(string[] args)
        {
            AppBuilder
                .Configure<App>()
                .UsePlatformDetect()
                .UseSkia()
                .StartWithClassicDesktopLifetime(args);
        }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Big Sur laggy mess when resizing window! : r/mac
My model has 16 gigs of memory and has only one tab open, definitely a chrome or mac os issue. Upvote 2
Read more >
Sluggish animation upon resizing window
macrumors 6502. I think that sluggish animation is normal, it is just an optic ilusion when web content is bein resized.
Read more >
Window resizing on macOS is so laggy
Open iTunes and go to the "Shop" tab and start resizing the window. It will lag. The same with iMovie when a project...
Read more >
resizing seems really slow · Issue #969 · alacritty ...
The window size changes shape pretty smoothly on my laptop, but we don't actually draw during resize on macOS as of today. I...
Read more >
MacOS High Sierra: Remove the lag when resizing a ...
Notice how the mouse pointer leads and the window lags when you resize the window fast.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found