Skip to content

Commit 8eed44b

Browse files
committed
Fix wasm builds with latest pugl changes
Signed-off-by: falkTX <[email protected]>
1 parent a1c1df7 commit 8eed44b

File tree

1 file changed

+13
-36
lines changed

1 file changed

+13
-36
lines changed

dgl/src/pugl-extra/wasm.c

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Copyright 2012-2022 David Robillard <[email protected]>
2-
// Copyright 2021-2022 Filipe Coelho <[email protected]>
2+
// Copyright 2021-2025 Filipe Coelho <[email protected]>
33
// SPDX-License-Identifier: ISC
44

55
#include "wasm.h"
66

77
#include "../pugl-upstream/src/internal.h"
8+
#include "../pugl-upstream/src/platform.h"
89

910
#include <stdio.h>
1011

@@ -82,8 +83,15 @@ puglInitViewInternals(PuglWorld* const world)
8283
return impl;
8384
}
8485

85-
static PuglStatus
86-
puglUpdateSizeHints(const PuglView* const view)
86+
PuglStatus
87+
puglApplySizeHint(PuglView* const view, const PuglSizeHint PUGL_UNUSED(hint))
88+
{
89+
// No fine-grained updates, hints are always recalculated together
90+
return puglUpdateSizeHints(view);
91+
}
92+
93+
PuglStatus
94+
puglUpdateSizeHints(PuglView* const view)
8795
{
8896
const char* const className = view->world->strings[PUGL_CLASS_NAME];
8997

@@ -1005,18 +1013,9 @@ puglViewStringChanged(PuglView*, const PuglStringHint key, const char* const val
10051013
}
10061014

10071015
PuglStatus
1008-
puglSetSizeHint(PuglView* const view,
1009-
const PuglSizeHint hint,
1010-
const unsigned width,
1011-
const unsigned height)
1016+
puglSetWindowSize(PuglView* const view, const unsigned width, const unsigned height)
10121017
{
1013-
const PuglStatus st = puglStoreSizeHint(view, hint, width, height);
1014-
if (st != PUGL_SUCCESS)
1015-
return st;
1016-
1017-
puglUpdateSizeHints(view);
1018-
1019-
if (hint == PUGL_CURRENT_SIZE && view->impl->created) {
1018+
if (view->impl->created) {
10201019
const char* const className = view->world->strings[PUGL_CLASS_NAME];
10211020
emscripten_set_canvas_element_size(className, width, height);
10221021
}
@@ -1248,25 +1247,3 @@ puglSetTransientParent(PuglView* const view, const PuglNativeView parent)
12481247
view->transientParent = parent;
12491248
return PUGL_FAILURE;
12501249
}
1251-
1252-
PuglStatus
1253-
puglSetPositionHint(PuglView* const view,
1254-
const PuglPositionHint hint,
1255-
const int x,
1256-
const int y)
1257-
{
1258-
if (x <= INT16_MIN || x > INT16_MAX || y <= INT16_MIN || y > INT16_MAX) {
1259-
return PUGL_BAD_PARAMETER;
1260-
}
1261-
1262-
view->positionHints[hint].x = (PuglCoord)x;
1263-
view->positionHints[hint].y = (PuglCoord)y;
1264-
1265-
if (!view->impl->created || hint != PUGL_CURRENT_POSITION) {
1266-
return PUGL_SUCCESS;
1267-
}
1268-
1269-
view->lastConfigure.x = x;
1270-
view->lastConfigure.y = y;
1271-
return puglObscureView(view);
1272-
}

0 commit comments

Comments
 (0)