mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 19:15:36 +00:00
[X11] Fixed INativeWindow.Cursor getter
This commit is contained in:
parent
d03e9d82dc
commit
96b7419d83
|
@ -1477,24 +1477,25 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
using (new XLock(window.Display))
|
using (new XLock(window.Display))
|
||||||
{
|
{
|
||||||
if (value == MouseCursor.Default)
|
if (value == MouseCursor.Default)
|
||||||
{
|
|
||||||
Functions.XUndefineCursor(window.Display, window.Handle);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fixed(byte* pixels = value.Rgba)
|
|
||||||
{
|
{
|
||||||
var xcursorimage = Functions.XcursorImageCreate(32, 32);
|
Functions.XUndefineCursor(window.Display, window.Handle);
|
||||||
xcursorimage->xhot = (uint)value.X;
|
|
||||||
xcursorimage->yhot = (uint)value.Y;
|
|
||||||
xcursorimage->pixels = (uint*)pixels;
|
|
||||||
xcursorimage->delay = 0;
|
|
||||||
cursorHandle = Functions.XcursorImageLoadCursor(window.Display, xcursorimage);
|
|
||||||
Functions.XDefineCursor(window.Display, window.Handle, cursorHandle);
|
|
||||||
Functions.XcursorImageDestroy(xcursorimage);
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
fixed(byte* pixels = value.Rgba)
|
||||||
|
{
|
||||||
|
var xcursorimage = Functions.XcursorImageCreate(value.Width, value.Height);
|
||||||
|
xcursorimage->xhot = (uint)value.X;
|
||||||
|
xcursorimage->yhot = (uint)value.Y;
|
||||||
|
xcursorimage->pixels = (uint*)pixels;
|
||||||
|
xcursorimage->delay = 0;
|
||||||
|
cursorHandle = Functions.XcursorImageLoadCursor(window.Display, xcursorimage);
|
||||||
|
Functions.XDefineCursor(window.Display, window.Handle, cursorHandle);
|
||||||
|
Functions.XcursorImageDestroy(xcursorimage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cursor = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue