GdkX11DeviceManagerXI2: handle focus events not on a known window
If we get a focus event for a X window we don't recognize, just ignore it and avoid a g-critical when _gdk_device_manager_core_handle_focus() is called with a NULL window.
This commit is contained in:
parent
645b5f398d
commit
06c4598fc5
@ -1569,22 +1569,25 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
|||||||
case XI_FocusIn:
|
case XI_FocusIn:
|
||||||
case XI_FocusOut:
|
case XI_FocusOut:
|
||||||
{
|
{
|
||||||
XIEnterEvent *xev = (XIEnterEvent *) ev;
|
if (window)
|
||||||
GdkDevice *device, *source_device;
|
{
|
||||||
|
XIEnterEvent *xev = (XIEnterEvent *) ev;
|
||||||
|
GdkDevice *device, *source_device;
|
||||||
|
|
||||||
device = g_hash_table_lookup (device_manager->id_table,
|
device = g_hash_table_lookup (device_manager->id_table,
|
||||||
GINT_TO_POINTER (xev->deviceid));
|
GINT_TO_POINTER (xev->deviceid));
|
||||||
|
|
||||||
source_device = g_hash_table_lookup (device_manager->id_table,
|
source_device = g_hash_table_lookup (device_manager->id_table,
|
||||||
GUINT_TO_POINTER (xev->sourceid));
|
GUINT_TO_POINTER (xev->sourceid));
|
||||||
|
|
||||||
_gdk_device_manager_core_handle_focus (window,
|
_gdk_device_manager_core_handle_focus (window,
|
||||||
xev->event,
|
xev->event,
|
||||||
device,
|
device,
|
||||||
source_device,
|
source_device,
|
||||||
(ev->evtype == XI_FocusIn) ? TRUE : FALSE,
|
(ev->evtype == XI_FocusIn) ? TRUE : FALSE,
|
||||||
xev->detail,
|
xev->detail,
|
||||||
xev->mode);
|
xev->mode);
|
||||||
|
}
|
||||||
|
|
||||||
return_val = FALSE;
|
return_val = FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user