
Programmatically resizing a non-user-resizable window on Linux fails (patch included)
Posted Wednesday, 22 August, 2012 - 15:49 by elisee| Project: | The Open Toolkit library |
| Version: | 1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | open |
Using the latest OpenTK trunk (r3125) on Linux, setting a non-user-resizable (WindowBorder == Fixed) window's ClientRectangle fails to change the window size.
From what I've gathered by searching online [1], This is because WindowBorder.Fixed is implemented by setting the window min and max size to the current window size and XResizeWindow events are clamped to those min & max sizes.
The bug can be fixed by changing the ClientRectangle setter (in X11GLNative.cs) from:
set { using (new XLock(window.Display)) { Functions.XResizeWindow(window.Display, window.WindowHandle, value.Width, value.Height); } ProcessEvents(); }
to
set { if( IsWindowBorderResizable ) { using (new XLock(window.Display)) { Functions.XResizeWindow(window.Display, window.WindowHandle, value.Width, value.Height); } } else { SetWindowMinMax( (short)value.Width, (short)value.Height, (short)value.Width, (short)value.Height ); } ProcessEvents(); }
I have found no direct way to submit a patch but feel free to point me to the right place if there is one.
EDIT: I haven't had a chance to look into it yet, but I just realized other setters like Bounds and Size most likely require a similar change since they use XResizeWindow / XMoveResizeWindow.
[1] http://lists.libsdl.org/pipermail/commits-libsdl.org/2011-April/004122.h...

