Skip to content
Merged

12 26 #178

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 14 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 8 additions & 2 deletions src/platform/sdl/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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()) {
Expand Down