[X11] Fixed border size on Gnome 3

The _NET_FRAME_EXTENTS atom is implemented differently by
different window managers, when window decorations are hidden
with Motif. Unity returns a 0 size, while Gnome 3 returns the
previous size.

This patch removes that ambiguity: when decorations are hidden,
border size becomes zero. This should work everywhere, unless
some window manager decides to troll us by decorating the window
when we explicitly request no decorations. Sigh...
This commit is contained in:
thefiddler 2013-12-27 13:31:51 +02:00
parent ab8796c942
commit 88f7cd68f5

View file

@ -625,10 +625,26 @@ namespace OpenTK.Platform.X11
#endregion
bool RefreshWindowBorders()
{
bool borders_changed = false;
if (IsWindowBorderHidden)
{
borders_changed =
border_left != 0 ||
border_right != 0 ||
border_top != 0 ||
border_bottom != 0;
border_left = 0;
border_right = 0;
border_top = 0;
border_bottom = 0;
}
else
{
IntPtr atom, nitems, bytes_after, prop = IntPtr.Zero;
int format;
bool borders_changed = false;
using (new XLock(window.Display))
{
@ -668,6 +684,7 @@ namespace OpenTK.Platform.X11
Functions.XFree(prop);
}
}
}
return borders_changed;
}
@ -719,7 +736,7 @@ namespace OpenTK.Platform.X11
Resize(this, EventArgs.Empty);
}
Debug.Print("[X11] Window bounds changed: {0}", bounds);
//Debug.Print("[X11] Window bounds changed: {0}", bounds);
}
static IntPtr CreateEmptyCursor(X11WindowInfo window)