Utility/X11: Fix crash at startup

This commit is contained in:
Lynix 2017-02-17 00:21:40 +01:00
parent dc158d06a8
commit a4100d5b4e
1 changed files with 13 additions and 2 deletions

View File

@ -164,8 +164,19 @@ namespace Nz
ScopedXCBConnection connection;
xcb_screen_t* screen = X11::XCBDefaultScreen(connection);
const char* cursorName = s_systemCursorIds[cursor];
if (cursorName)
{
if (xcb_cursor_context_new(connection, screen, &m_cursorContext) >= 0)
m_cursor = xcb_cursor_load_cursor(m_cursorContext, s_systemCursorIds[cursor]);
m_cursor = xcb_cursor_load_cursor(m_cursorContext, cursorName);
else
{
NazaraError("Failed to create cursor context");
return false;
}
}
else
m_cursor = s_hiddenCursor;
return true;
}