Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#8248 from AvaloniaUI/fixes/prevent-pare…
Browse files Browse the repository at this point in the history
…nt-resizing-when-modal-opened

[OSX] dont allow disabled windows to resize.
  • Loading branch information
danwalmsley authored Jun 2, 2022
2 parents 651c4be + 97a04c6 commit 4f036d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions native/Avalonia.Native/src/OSX/WindowImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class WindowImpl : public virtual WindowBaseImpl, public virtual IAvnWindow, public IWindowStateChanged
{
private:
bool _isEnabled;
bool _canResize;
bool _fullScreenActive;
SystemDecorations _decorations;
Expand Down
5 changes: 4 additions & 1 deletion native/Avalonia.Native/src/OSX/WindowImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "WindowProtocol.h"

WindowImpl::WindowImpl(IAvnWindowEvents *events, IAvnGlContext *gl) : WindowBaseImpl(events, gl) {
_isEnabled = true;
_children = std::list<WindowImpl*>();
_isClientAreaExtended = false;
_extendClientHints = AvnDefaultChrome;
Expand Down Expand Up @@ -75,7 +76,9 @@
START_COM_CALL;

@autoreleasepool {
_isEnabled = enable;
[GetWindowProtocol() setEnabled:enable];
UpdateStyle();
return S_OK;
}
}
Expand Down Expand Up @@ -573,7 +576,7 @@
case SystemDecorationsFull:
s = s | NSWindowStyleMaskTitled | NSWindowStyleMaskClosable;

if (_canResize) {
if (_canResize && _isEnabled) {
s = s | NSWindowStyleMaskResizable;
}
break;
Expand Down

0 comments on commit 4f036d7

Please sign in to comment.