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

WindowStartupLocation = WindowStartupLocation.CenterOwner does not work on multiple displays #186

Open
digitaldias opened this issue Jul 25, 2024 · 0 comments

Comments

@digitaldias
Copy link

digitaldias commented Jul 25, 2024

I have two screens, and if I move my app to the secondary screen and run this:

    private async Task<bool> GetUserConfirmation(string title, string message)
    {
        return await Dispatcher.UIThread.InvokeAsync(async () =>
        {
            var dialog = MessageBoxManager.GetMessageBoxStandard(new MessageBoxStandardParams
            {
                ButtonDefinitions = MsBox.Avalonia.Enums.ButtonEnum.YesNo,
                ContentTitle = title,
                ContentMessage = message,
                Icon = MsBox.Avalonia.Enums.Icon.Question,
                WindowStartupLocation = WindowStartupLocation.CenterOwner,
                EscDefaultButton = MsBox.Avalonia.Enums.ClickEnum.Ok,
            });

            var buttonPressed = await dialog.ShowWindowDialogAsync(_parentWindow);
            return buttonPressed == MsBox.Avalonia.Enums.ButtonResult.Yes;
        });
    }

The dialog will appear between my two displays. I can't get a window for it either, so I can't fix it unless you have a good way to grab the Window component of this dialog by a nice cast.

Edit:
I realize that I may be doing something wrong, too, but It'd be nice to know.
Here is a picture of how it looks on my second display. It is fine and centered on my primary display.
image

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

1 participant