From 9edb6effa62a28da0731675f3a36065cd0d0b8a8 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Thu, 15 Sep 2022 00:39:58 -0700 Subject: [PATCH] Set SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH --- docs/CHANGES.txt | 5 +++++ src/tuxpaint.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 349ca245c..18a57343d 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -52,6 +52,11 @@ http://www.tuxpaint.org/ Pere Pujal i Carabantes Closes https://sourceforge.net/p/tuxpaint/bugs/256/ + * Receive clicks when Tux Paint window is regaining focus + (via "SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH"), which is how + the earlier SDL1.2 versions worked. + Bill Kendrick + * Other Improvements: ------------------- * Automatic button size option ("buttonsize=auto"), to scale button diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 64d2dcdcd..8b1c535b8 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -29444,6 +29444,11 @@ static void setup(void) } } + /* Clicking into window while unfocused would not let + the clicks through, which was unlike how things worked + in SDL1.2, and I found that annoying -bjk 2022.09.15 */ + SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); + /* Set up event filter */ SDL_SetEventFilter(TP_EventFilter, NULL); @@ -29684,7 +29689,6 @@ static void setup(void) } } #endif - } else {