forked from bartvdbraak/blender
Fix compilation with WITH_X11_XINPUT=OFF
This commit is contained in:
parent
6558a22b91
commit
36641078f8
@ -1211,11 +1211,13 @@ installDrawingContext(
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case GHOST_kDrawingContextTypeOpenGL:
|
case GHOST_kDrawingContextTypeOpenGL:
|
||||||
{
|
{
|
||||||
|
#ifdef WITH_X11_XINPUT
|
||||||
/* use our own event handlers to avoid exiting blender,
|
/* use our own event handlers to avoid exiting blender,
|
||||||
* this would happen for eg:
|
* this would happen for eg:
|
||||||
* if you open blender, unplug a tablet, then open a new window. */
|
* if you open blender, unplug a tablet, then open a new window. */
|
||||||
XErrorHandler old_handler = XSetErrorHandler(GHOST_X11_ApplicationErrorHandler);
|
XErrorHandler old_handler = XSetErrorHandler(GHOST_X11_ApplicationErrorHandler);
|
||||||
XIOErrorHandler old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
|
XIOErrorHandler old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);
|
m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);
|
||||||
if (m_context != NULL) {
|
if (m_context != NULL) {
|
||||||
@ -1231,10 +1233,11 @@ installDrawingContext(
|
|||||||
success = GHOST_kFailure;
|
success = GHOST_kFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_X11_XINPUT
|
||||||
/* Restore handler */
|
/* Restore handler */
|
||||||
(void) XSetErrorHandler(old_handler);
|
(void) XSetErrorHandler(old_handler);
|
||||||
(void) XSetIOErrorHandler(old_handler_io);
|
(void) XSetIOErrorHandler(old_handler_io);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GHOST_kDrawingContextTypeNone:
|
case GHOST_kDrawingContextTypeNone:
|
||||||
|
Loading…
Reference in New Issue
Block a user