Resize fixes #129

Merged
OragonEfreet merged 11 commits from wayland-libdecor into main 2026-06-01 13:54:51 +02:00
Owner
No description provided.
The scene uses hardcoded coordinates sized for 500x500, and the drawing
primitives don't clip, so drawing straight into a resizable framebuffer
would write out of bounds the moment the window shrinks. Instead render
the scene once into a fixed 500x500 off-screen canvas and scale that onto
the framebuffer each frame with bj_blit_stretched, which clips to the
destination. This is the fixed-internal-resolution pattern the
bj_window_resize_fn docs describe. The window gains
BJ_WINDOW_FLAG_RESIZABLE and the tutorial block explains the approach.

Also drop the manual bj_sleep from step: bj_run_app already paces the
loop to its frame rate, so the sleep only throttled event handling (and
made the resize crawl).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
examples: drop redundant bj_sleep in event_polling
Some checks failed
Documentation / build-docs (pull_request) Successful in 9s
QA / cert (pull_request) Failing after 25s
Build and Test / linux-linux-gcc (pull_request) Successful in 17s
Build and Test / linux-windows-mingw (pull_request) Successful in 28s
740c159f87
bj_run_app paces the loop to its frame rate (60 Hz by default) and sleeps
off the remainder of each frame itself, so the manual bj_sleep(30) in step
was a leftover from before that pacing existed. It throttled the loop to
~33 Hz, which capped how fast the example acked Wayland resize configures
and made interactive resize lag. Remove it (and the now-unused time.h).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bj_run_app paces the loop to its frame rate (60 Hz by default) and sleeps
off the remainder of each frame itself, so a manual bj_sleep in step was
a leftover from before that pacing existed; it only throttled event
handling. Remove it from the event/render-loop examples along with the
now-unused time.h include, and drop the stray pacing comment a prior
step had left in drawing_2d.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 120 ms bj_sleep both set the animation speed and throttled the loop.
Advance one sprite frame per 120 ms accumulated from tick.delta instead,
so the animation runs at a fixed ~8 FPS independent of the loop rate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bring event_polling to feature parity with event_callbacks. The window
was already resizable but the example ignored resizes. Resize is not a
queued event type, so register a bj_set_resize_callback (as
event_callbacks does) and count/log it, showing input polling and a
resize callback coexisting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
examples: make time and stopwatch plain console programs
Some checks failed
Documentation / build-docs (pull_request) Successful in 9s
QA / cert (pull_request) Failing after 24s
Build and Test / linux-linux-gcc (pull_request) Successful in 17s
Build and Test / linux-windows-mingw (pull_request) Successful in 27s
872cc0280b
Neither has a window or events to drive, so wrapping them in bj_run_app
(setup/step/teardown) was ceremony that also made their bj_sleep look
like a redundant pacing leftover. Rewrite each as a plain main() loop
where bj_sleep legitimately paces its own loop. They are desktop-only as
a result (a blocking loop would not cooperate with the browser on an
Emscripten build), which is fine for a console timing demo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OragonEfreet changed title from WIP: Resize fixes to Resize fixes 2026-06-01 13:26:13 +02:00
OragonEfreet added this to the 1.0 milestone 2026-06-01 13:26:15 +02:00
Wayland: bind only the libdecor symbols the backend uses (cert-dcl37-c)
All checks were successful
Documentation / build-docs (pull_request) Successful in 10s
QA / cert (pull_request) Successful in 29s
Build and Test / linux-linux-gcc (pull_request) Successful in 17s
Build and Test / linux-windows-mingw (pull_request) Successful in 27s
4519fb59b4
The QA clang-tidy run (--checks=cert-*) flagged four _bj_libdecor_*
declarations as reserved identifiers (cert-dcl37-c): get_fd, dispatch,
frame_set_capabilities, and configuration_get_window_state. They were
resolved but never called; the used _bj_* shim symbols (here and in the
libwayland / libxkbcommon shims) do not trip the check. Drop the four
unused entry points from the shim, storage, resolver, and the README
table so the libdecor shim is all-used like the others.

No behaviour change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OragonEfreet deleted branch wayland-libdecor 2026-06-01 13:54:51 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OragonEfreet/banjo!129
No description provided.