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

[macOS] CanResize is ignored when SystemDecorations = None #17295

Open
BAndysc opened this issue Oct 16, 2024 · 1 comment · May be fixed by #17355
Open

[macOS] CanResize is ignored when SystemDecorations = None #17295

BAndysc opened this issue Oct 16, 2024 · 1 comment · May be fixed by #17355
Labels
bug help-wanted A contribution from the community would be most welcome. os-macos

Comments

@BAndysc
Copy link
Contributor

BAndysc commented Oct 16, 2024

Describe the bug

switch (_decorations) {
case SystemDecorationsNone:
s = s | NSWindowStyleMaskFullSizeContentView;
break;
case SystemDecorationsBorderOnly:
s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView;
break;
case SystemDecorationsFull:
s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskClosable;
if ((_canResize && _isEnabled) || _transitioningWindowState) {
s = s | NSWindowStyleMaskResizable;
}
break;
}

here, NSWindowStyleMaskResizable is applied only if SystemDecorations = Full, otherwise this flag is not applied and the window is not resizable. I don't think there is a reason to apply it only in SystemDecorations = Full case.
For the Classic Theme, I wanted to disable decorations on macOS, which causes rounded corners and adds shadow, but the window still should be resizable when CanResize = true.

To Reproduce

Create a window, set SystemDecorations = None and set CanResize = true (default) - the window won't be resizable.

Expected behavior

No response

Avalonia version

11.1.x

OS

macOS

Additional context

No response

@timunie
Copy link
Contributor

timunie commented Oct 17, 2024

I think this is an issue only for mac-os

As you seem to already know a possible solution, a PR would be welcome.

@timunie timunie added the help-wanted A contribution from the community would be most welcome. label Oct 17, 2024
@BAndysc BAndysc linked a pull request Oct 26, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A contribution from the community would be most welcome. os-macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants