Skip to content

Commit

Permalink
[OSX] dont allow disabled windows to resize.
Browse files Browse the repository at this point in the history
  • Loading branch information
danwalmsley committed Jun 2, 2022
1 parent 651c4be commit 97a04c6
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 97a04c6

Please sign in to comment.