Skip to content

Commit 8bd353d

Browse files
authored
Merge pull request #178 from chrisws/12_26
12 26
2 parents b9aa056 + 01d128a commit 8bd353d

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2023-01-20 (12.26)
2+
SDL: Fixed an issue with window resizing #144
3+
14
2023-01-20 (12.26)
25
COMMON: Fixed DIM lower bound
36
COMMON: RGB and RGBF now clamp parameters

configure.ac

+14-1
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,23 @@ function buildSDL() {
212212

213213
(cd images && xxd -i sb-desktop-128x128.png > ../src/platform/sdl/icon.h)
214214

215+
HAVE_SDL2_STATIC=yes
216+
AC_MSG_CHECKING([if installed SDL2 supports static libs])
217+
AC_PATH_PROGS_FEATURE_CHECK([SDL2_STATIC_TMP], [sdl2-config],
218+
AS_IF([`"$ac_path_SDL2_STATIC_TMP" --static-libs 2>&1 | sed '/Usage/!{q1};' > /dev/null`], [HAVE_SDL2_STATIC=no]))
219+
AC_MSG_RESULT([$HAVE_SDL2_STATIC])
220+
221+
if test "x$HAVE_SDL2_STATIC" = "xno"; then
222+
SDL_LIBS=`sdl2-config --libs`
223+
else
224+
SDL_LIBS=`sdl2-config --static-libs`
225+
fi
226+
215227
dnl backlinking support for modules
216228
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl -no-pie"
217229
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
218-
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `pkg-config freetype2 --libs`"
230+
231+
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} ${SDL_LIBS} `pkg-config freetype2 --libs`"
219232
esac
220233

221234
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `pkg-config freetype2 --cflags` -fno-exceptions"

src/platform/sdl/runtime.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -533,14 +533,19 @@ void Runtime::pollEvents(bool blocking) {
533533
case SDL_WINDOWEVENT_FOCUS_GAINED:
534534
break;
535535
case SDL_WINDOWEVENT_RESIZED:
536+
case SDL_WINDOWEVENT_SIZE_CHANGED:
536537
onResize(ev.window.data1, ev.window.data2);
537538
break;
538539
case SDL_WINDOWEVENT_EXPOSED:
540+
case SDL_WINDOWEVENT_SHOWN:
539541
_graphics->redraw();
540542
break;
541543
case SDL_WINDOWEVENT_LEAVE:
542544
_output->removeHover();
543545
break;
546+
default:
547+
trace("Unhandled window event [%d]", ev.window.event);
548+
break;
544549
}
545550
break;
546551
case SDL_DROPFILE:
@@ -611,8 +616,6 @@ void Runtime::setWindowRect(int x, int y, int width, int height) {
611616
logEntered();
612617
if (width > 0 && height > 0) {
613618
SDL_SetWindowSize(_window, width, height);
614-
_graphics->resize(width, height);
615-
resize();
616619
}
617620
if (x > 0 && y > 0) {
618621
SDL_SetWindowPosition(_window, x, y);
@@ -714,10 +717,13 @@ void Runtime::saveWindowRect() {
714717
//
715718
// System platform methods
716719
//
720+
#pragma GCC diagnostic push
721+
#pragma GCC diagnostic ignored "-Wint-in-bool-context"
717722
bool System::getPen3() {
718723
SDL_PumpEvents();
719724
return (SDL_BUTTON(SDL_BUTTON_LEFT) && SDL_GetMouseState(&_touchCurX, &_touchCurY));
720725
}
726+
#pragma GCC diagnostic pop
721727

722728
void System::completeKeyword(int index) const {
723729
if (get_focus_edit() && isEditing()) {

0 commit comments

Comments
 (0)