Browse Source

x11-force window size hints when window disabled (#14859)

pull/14871/head
Emmanuel Hansen 2 years ago
committed by GitHub
parent
commit
5ba70158df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      src/Avalonia.X11/X11Window.cs

17
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()

Loading…
Cancel
Save