add NULL check for XInput device, since its possible only one is valid.
This commit is contained in:
@@ -521,9 +521,15 @@ static void setTabletMode(GHOST_SystemX11 *system, GHOST_WindowX11 *window, XID
|
|||||||
#ifdef WITH_X11_XINPUT
|
#ifdef WITH_X11_XINPUT
|
||||||
static bool checkTabletProximity(Display *display, XDevice *device)
|
static bool checkTabletProximity(Display *display, XDevice *device)
|
||||||
{
|
{
|
||||||
|
/* we could have true/false/not-found return value, but for now false is OK */
|
||||||
|
|
||||||
/* see: state.c from xinput, to get more data out of the device */
|
/* see: state.c from xinput, to get more data out of the device */
|
||||||
XDeviceState *state;
|
XDeviceState *state;
|
||||||
|
|
||||||
|
if (device == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
state = XQueryDeviceState(display, device);
|
state = XQueryDeviceState(display, device);
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
|
@@ -1798,7 +1798,7 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
|
|||||||
if ((state & UI_BUT_DISABLED) && (state & UI_ACTIVE)) {
|
if ((state & UI_BUT_DISABLED) && (state & UI_ACTIVE)) {
|
||||||
widget_state_blend(wt->wcol.text, wt->wcol.text_sel, 0.5f);
|
widget_state_blend(wt->wcol.text, wt->wcol.text_sel, 0.5f);
|
||||||
/* draw the backdrop at low alpha, helps navigating with keys
|
/* draw the backdrop at low alpha, helps navigating with keys
|
||||||
* when inactive items are active */
|
* when disabled items are active */
|
||||||
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
|
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
|
||||||
wt->wcol.inner[3] = 64;
|
wt->wcol.inner[3] = 64;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user