Emmanuel Hansen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
15 additions and
2 deletions
-
src/Avalonia.X11/X11Window.cs
|
|
|
@ -297,6 +297,12 @@ namespace Avalonia.X11 |
|
|
|
if (!IsEnabled) |
|
|
|
{ |
|
|
|
functions &= ~(MotifFunctions.Resize | MotifFunctions.Minimize); |
|
|
|
|
|
|
|
UpdateSizeHints(null, true); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
UpdateSizeHints(null); |
|
|
|
} |
|
|
|
|
|
|
|
var hints = new MotifWmHints |
|
|
|
@ -311,14 +317,14 @@ namespace Avalonia.X11 |
|
|
|
PropertyMode.Replace, ref hints, 5); |
|
|
|
} |
|
|
|
|
|
|
|
private void UpdateSizeHints(PixelSize? preResize) |
|
|
|
private void UpdateSizeHints(PixelSize? preResize, bool forceDisableResize = false) |
|
|
|
{ |
|
|
|
if (_overrideRedirect) |
|
|
|
return; |
|
|
|
var min = _minMaxSize.minSize; |
|
|
|
var max = _minMaxSize.maxSize; |
|
|
|
|
|
|
|
if (!_canResize) |
|
|
|
if (!_canResize || forceDisableResize) |
|
|
|
{ |
|
|
|
if (preResize.HasValue) |
|
|
|
{ |
|
|
|
@ -1293,6 +1299,13 @@ namespace Avalonia.X11 |
|
|
|
|
|
|
|
UpdateWMHints(); |
|
|
|
UpdateMotifHints(); |
|
|
|
|
|
|
|
if (enable) |
|
|
|
{ |
|
|
|
// Some window managers ignore Motif hints when switching from disabled to enabled on the first update
|
|
|
|
// so setting it again forces the update
|
|
|
|
UpdateMotifHints(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void UpdateWMHints() |
|
|
|
|