Merge pull request #261 from Frassle/resize

X11: Fix so ClientSize can resize windows with fixed borders
This commit is contained in:
Fraser Waters 2015-05-29 10:40:35 +01:00
Родитель 788b039e32 0fb149f97b
Коммит e6e8b7a357
2 изменённых файлов: 18 добавлений и 6 удалений

Просмотреть файл

@ -417,8 +417,7 @@ namespace OpenTK.Platform
}
set
{
Rectangle old = ClientRectangle;
ClientRectangle = new Rectangle(old.X, old.Y, value, old.Height);
ClientSize = new Size(value, ClientSize.Height);
}
}
@ -430,8 +429,7 @@ namespace OpenTK.Platform
}
set
{
Rectangle old = ClientRectangle;
Bounds = new Rectangle(old.X, old.Y, old.Width, value);
ClientSize = new Size(ClientSize.Width, value);
}
}

Просмотреть файл

@ -1072,11 +1072,25 @@ namespace OpenTK.Platform.X11
}
set
{
bool is_size_changed = client_rectangle.Size != value;
int width = value.Width;
int height = value.Height;
if (WindowBorder != WindowBorder.Resizable)
{
SetWindowMinMax(width, height, width, height);
}
using (new XLock(window.Display))
{
Functions.XResizeWindow(window.Display, window.Handle,
value.Width, value.Height);
if (is_size_changed)
{
Functions.XResizeWindow(window.Display, window.Handle,
width, height);
}
}
ProcessEvents();
}
}