mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-10-26 15:13:22 +03:00
Add a little more event loop debug output
This commit is contained in:
parent
e7173f8145
commit
003cd0a203
@ -21,6 +21,12 @@
|
||||
#include <signal.h>
|
||||
extern PyTypeObject Screen_Type;
|
||||
|
||||
#ifdef DEBUG_EVENT_LOOP
|
||||
#define EVDBG(...) log_event(__VA_ARGS__)
|
||||
#else
|
||||
#define EVDBG(...)
|
||||
#endif
|
||||
|
||||
#define EXTRA_FDS 2
|
||||
#ifndef MSG_NOSIGNAL
|
||||
// Apple does not implement MSG_NOSIGNAL
|
||||
@ -884,6 +890,7 @@ static void process_global_state(void *data);
|
||||
|
||||
static void
|
||||
do_state_check(id_type timer_id UNUSED, void *data UNUSED) {
|
||||
EVDBG("State check timer fired");
|
||||
#ifdef __APPLE__
|
||||
process_global_state(data);
|
||||
#endif
|
||||
@ -896,6 +903,7 @@ static id_type state_check_timer = 0;
|
||||
|
||||
static void
|
||||
process_global_state(void *data) {
|
||||
EVDBG("Processing global state");
|
||||
ChildMonitor *self = data;
|
||||
maximum_wait = -1;
|
||||
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);
|
||||
|
||||
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 {{{
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user