diff --git a/include/QF/input/event.h b/include/QF/input/event.h index 4e046d3ce..bf8e44b95 100644 --- a/include/QF/input/event.h +++ b/include/QF/input/event.h @@ -122,6 +122,7 @@ typedef struct IE_event_s { typedef int ie_handler_t (const IE_event_t *, void *data); +void IN_Event_Init (void); int IE_Send_Event (const IE_event_t *event); int IE_Add_Handler (ie_handler_t *event_handler, void *data); void IE_Remove_Handler (int handle); diff --git a/libs/input/in_axis.c b/libs/input/in_axis.c index 51a3b787e..3ed6bcc94 100644 --- a/libs/input/in_axis.c +++ b/libs/input/in_axis.c @@ -120,6 +120,7 @@ IN_AxisRemoveListener (in_axis_t *axis, axis_listener_t listener, void *data) static void in_axis_shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "in_axis_shutdown\n"); Hash_DelTable (axis_tab); } diff --git a/libs/input/in_binding.c b/libs/input/in_binding.c index e2c6787f3..3c5dc53ce 100644 --- a/libs/input/in_binding.c +++ b/libs/input/in_binding.c @@ -781,6 +781,7 @@ IN_Binding_Activate (void) static void IN_Binding_Shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "IN_Binding_Shutdown\n"); for (in_devbindings_t *db = devbindings_list; db; db = db->next) { clear_connection (db); } diff --git a/libs/input/in_button.c b/libs/input/in_button.c index 38f2f1ea6..5d49cf68c 100644 --- a/libs/input/in_button.c +++ b/libs/input/in_button.c @@ -260,6 +260,7 @@ IN_ButtonClearStates (void) static void in_button_shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "in_button_shutdown\n"); Hash_DelTable (button_tab); } diff --git a/libs/input/in_common.c b/libs/input/in_common.c index 896f01dbb..f888a178d 100644 --- a/libs/input/in_common.c +++ b/libs/input/in_common.c @@ -530,9 +530,7 @@ IN_LoadConfig (plitem_t *config) static void IN_shutdown (void *data) { - //JOY_Shutdown (); - - Sys_MaskPrintf (SYS_vid, "IN_shutdown\n"); + Sys_MaskPrintf (SYS_input, "IN_shutdown\n"); for (size_t i = in_drivers.size; i-- > 0; ) { in_regdriver_t *rd = &in_drivers.a[i]; if (rd->driver.shutdown) { @@ -548,6 +546,7 @@ void IN_Init (void) { Sys_RegisterShutdown (IN_shutdown, 0); + IN_Event_Init (); IN_ButtonInit (); IN_AxisInit (); IMT_Init (); diff --git a/libs/input/in_evdev.c b/libs/input/in_evdev.c index af49d2677..41b4c8626 100644 --- a/libs/input/in_evdev.c +++ b/libs/input/in_evdev.c @@ -75,6 +75,7 @@ in_evdev_check_select (qf_fd_set *fdset, void *data) static void in_evdev_shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "in_evdev_shutdown\n"); inputlib_close (); for (unsigned i = 0; i < devmap._size; i++) { diff --git a/libs/input/in_event.c b/libs/input/in_event.c index e5240f3b9..52d3f91a2 100644 --- a/libs/input/in_event.c +++ b/libs/input/in_event.c @@ -124,12 +124,12 @@ IE_Get_Focus (void) static void in_event_shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "in_event_shutdown\n"); DARRAY_CLEAR (&ie_handlers); } -static void __attribute__((constructor)) -in_event_init (void) +void +IN_Event_Init (void) { - //FIXME see in_evdev Sys_RegisterShutdown (in_event_shutdown, 0); } diff --git a/libs/input/in_imt.c b/libs/input/in_imt.c index c390783ca..3d679cbff 100644 --- a/libs/input/in_imt.c +++ b/libs/input/in_imt.c @@ -939,6 +939,7 @@ static imtcmd_t imt_commands[] = { static void IMT_Shutdown (void *data) { + Sys_MaskPrintf (SYS_input, "IMT_Shutdown\n"); imt_drop_all_f (); Hash_DelTable (recipe_tab);