From 37ecf119262a027e6123253f8c76e4799b0eec6e Mon Sep 17 00:00:00 2001 From: cat Date: Sun, 25 May 2025 22:30:34 +1000 Subject: [PATCH] x11 override redirect + mouseclick test --- slutpet.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/slutpet.c b/slutpet.c index e733c20..1f209a0 100644 --- a/slutpet.c +++ b/slutpet.c @@ -38,6 +38,13 @@ SDL_AppResult SDL_AppEvent(void *as, SDL_Event *ev) { switch (ev->type) { + case SDL_EVENT_MOUSE_BUTTON_DOWN: + babble("mouse button down event"); + if (ev->button.button == SDL_BUTTON_RIGHT) { + babble("right-click quit requested"); + return SDL_APP_SUCCESS; + } + break; case SDL_EVENT_QUIT: babble("quit requested"); return SDL_APP_SUCCESS; @@ -80,6 +87,8 @@ SDL_AppInit(void **as, int argc, char **argv) } *as = st; + SDL_SetHint(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, "1"); + babble("create win+render..."); if (!SDL_CreateWindowAndRenderer("slutpet", 320, 240, SDL_WINDOW_TRANSPARENT | SDL_WINDOW_BORDERLESS