diff --git a/ChangeLog b/ChangeLog index fc45077e..0ef350f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2023-01-20 (12.26) + SDL: Fixed an issue with window resizing #144 + 2023-01-20 (12.26) COMMON: Fixed DIM lower bound COMMON: RGB and RGBF now clamp parameters diff --git a/configure.ac b/configure.ac index 03a831ab..dbcf0dc6 100644 --- a/configure.ac +++ b/configure.ac @@ -212,10 +212,23 @@ function buildSDL() { (cd images && xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h) + HAVE_SDL2_STATIC=yes + AC_MSG_CHECKING([if installed SDL2 supports static libs]) + AC_PATH_PROGS_FEATURE_CHECK([SDL2_STATIC_TMP], [sdl2-config], + AS_IF([`"$ac_path_SDL2_STATIC_TMP" --static-libs 2>&1 | sed '/Usage/!{q1};' > /dev/null`], [HAVE_SDL2_STATIC=no])) + AC_MSG_RESULT([$HAVE_SDL2_STATIC]) + + if test "x$HAVE_SDL2_STATIC" = "xno"; then + SDL_LIBS=`sdl2-config --libs` + else + SDL_LIBS=`sdl2-config --static-libs` + fi + dnl backlinking support for modules PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie" PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}" - PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`" + + PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} ${SDL_LIBS} `pkg-config freetype2 --libs`" esac PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg-config freetype2 --cflags` -fno-exceptions" diff --git a/src/platform/sdl/runtime.cpp b/src/platform/sdl/runtime.cpp index d0e6dc71..49bab154 100644 --- a/src/platform/sdl/runtime.cpp +++ b/src/platform/sdl/runtime.cpp @@ -533,14 +533,19 @@ void Runtime::pollEvents(bool blocking) { case SDL_WINDOWEVENT_FOCUS_GAINED: break; case SDL_WINDOWEVENT_RESIZED: + case SDL_WINDOWEVENT_SIZE_CHANGED: onResize(ev.window.data1, ev.window.data2); break; case SDL_WINDOWEVENT_EXPOSED: + case SDL_WINDOWEVENT_SHOWN: _graphics->redraw(); break; case SDL_WINDOWEVENT_LEAVE: _output->removeHover(); break; + default: + trace("Unhandled window event [%d]", ev.window.event); + break; } break; case SDL_DROPFILE: @@ -611,8 +616,6 @@ void Runtime::setWindowRect(int x, int y, int width, int height) { logEntered(); if (width > 0 && height > 0) { SDL_SetWindowSize(_window, width, height); - _graphics->resize(width, height); - resize(); } if (x > 0 && y > 0) { SDL_SetWindowPosition(_window, x, y); @@ -714,10 +717,13 @@ void Runtime::saveWindowRect() { // // System platform methods // +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wint-in-bool-context" bool System::getPen3() { SDL_PumpEvents(); return (SDL_BUTTON(SDL_BUTTON_LEFT) && SDL_GetMouseState(&_touchCurX, &_touchCurY)); } +#pragma GCC diagnostic pop void System::completeKeyword(int index) const { if (get_focus_edit() && isEditing()) {