mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-06 16:20:36 +00:00
[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:
parent
ab8796c942
commit
88f7cd68f5
|
@ -625,10 +625,26 @@ namespace OpenTK.Platform.X11
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
bool RefreshWindowBorders()
|
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;
|
IntPtr atom, nitems, bytes_after, prop = IntPtr.Zero;
|
||||||
int format;
|
int format;
|
||||||
bool borders_changed = false;
|
|
||||||
|
|
||||||
using (new XLock(window.Display))
|
using (new XLock(window.Display))
|
||||||
{
|
{
|
||||||
|
@ -668,6 +684,7 @@ namespace OpenTK.Platform.X11
|
||||||
Functions.XFree(prop);
|
Functions.XFree(prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return borders_changed;
|
return borders_changed;
|
||||||
}
|
}
|
||||||
|
@ -719,7 +736,7 @@ namespace OpenTK.Platform.X11
|
||||||
Resize(this, EventArgs.Empty);
|
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)
|
static IntPtr CreateEmptyCursor(X11WindowInfo window)
|
||||||
|
|
Loading…
Reference in a new issue