Loop your X cursor around the screen 👉😎👉
git clone https://mcol.xyz/code/xoop
Log | Files | Refs | README | LICENSE

commit f4f89cda663f9cc2a3effc6237e5b724f5a9d67a
parent ea612441915ba2a396fbd666c7f2c6f9bba9520e
Author: mcol <mcol@posteo.net>
Date:   Sat, 18 Apr 2020 20:56:46 +0100

add debug make target

Diffstat:
Mmakefile | 5++++-
Mxoop.c | 5++++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/makefile b/makefile @@ -6,6 +6,9 @@ BINPREFIX ?= $(PREFIX)/bin all: $(OUT) +debug: CFLAGS += -g -DDEBUG +debug: all + clean: $(RM) $(OUT) $(OBJ) @@ -17,4 +20,4 @@ uninstall: rm -f "$(DESTDIR)$(BINPREFIX)"/xoop -.PHONY: all clean install uninstall +.PHONY: all debug clean install uninstall diff --git a/xoop.c b/xoop.c @@ -101,7 +101,8 @@ void event_loop() { xcb_generic_event_t *event; xcb_enter_notify_event_t *entry; - int16_t x, y; + int16_t x = 0; + int16_t y = 0; int16_t far_x = screen->width_in_pixels - 1; int16_t far_y = screen->height_in_pixels - 1; @@ -129,7 +130,9 @@ void event_loop() conn, XCB_NONE, screen->root, 0, 0, 0, 0, x, y ); xcb_flush(conn); +#ifdef DEBUG printf("(%d, %d) to (%d, %d)\n", entry->event_x, entry->event_y, x, y); +#endif break; }