Add a little more event loop debug output
This commit is contained in:
@@ -21,6 +21,12 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
extern PyTypeObject Screen_Type;
|
extern PyTypeObject Screen_Type;
|
||||||
|
|
||||||
|
#ifdef DEBUG_EVENT_LOOP
|
||||||
|
#define EVDBG(...) log_event(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define EVDBG(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EXTRA_FDS 2
|
#define EXTRA_FDS 2
|
||||||
#ifndef MSG_NOSIGNAL
|
#ifndef MSG_NOSIGNAL
|
||||||
// Apple does not implement MSG_NOSIGNAL
|
// Apple does not implement MSG_NOSIGNAL
|
||||||
@@ -884,6 +890,7 @@ static void process_global_state(void *data);
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
do_state_check(id_type timer_id UNUSED, void *data UNUSED) {
|
do_state_check(id_type timer_id UNUSED, void *data UNUSED) {
|
||||||
|
EVDBG("State check timer fired");
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
process_global_state(data);
|
process_global_state(data);
|
||||||
#endif
|
#endif
|
||||||
@@ -896,6 +903,7 @@ static id_type state_check_timer = 0;
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
process_global_state(void *data) {
|
process_global_state(void *data) {
|
||||||
|
EVDBG("Processing global state");
|
||||||
ChildMonitor *self = data;
|
ChildMonitor *self = data;
|
||||||
maximum_wait = -1;
|
maximum_wait = -1;
|
||||||
bool state_check_timer_enabled = false;
|
bool state_check_timer_enabled = false;
|
||||||
|
|||||||
@@ -313,3 +313,4 @@ SPRITE_MAP_HANDLE alloc_sprite_map(unsigned int, unsigned int);
|
|||||||
SPRITE_MAP_HANDLE free_sprite_map(SPRITE_MAP_HANDLE);
|
SPRITE_MAP_HANDLE free_sprite_map(SPRITE_MAP_HANDLE);
|
||||||
|
|
||||||
static inline void safe_close(int fd) { while(close(fd) != 0 && errno == EINTR); }
|
static inline void safe_close(int fd) { while(close(fd) != 0 && errno == EINTR); }
|
||||||
|
void log_event(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
|
|||||||
16
kitty/glfw.c
16
kitty/glfw.c
@@ -66,6 +66,22 @@ update_os_window_viewport(OSWindow *window, bool notify_boss) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
log_event(const char *format, ...) {
|
||||||
|
if (format)
|
||||||
|
{
|
||||||
|
va_list vl;
|
||||||
|
|
||||||
|
fprintf(stderr, "[%.4f] ", glfwGetTime());
|
||||||
|
va_start(vl, format);
|
||||||
|
vfprintf(stderr, format, vl);
|
||||||
|
va_end(vl);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// callbacks {{{
|
// callbacks {{{
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user