gtk: present the framebuffer (size the picture, tick the frame clock) - #93
Merged
Conversation
The GTK4-hosted window came up blank: the GtkPicture was Put into the GtkFixed at 0,0 with no size, and a GtkFixed gives each child its requested size — a content-less GtkPicture requests 0×0, so the framebuffer was laid out invisibly. Size the picture to the logical window. And present every frame, not once. Run() drew a single frame before the window was mapped (the frame clock had not started) and before an immediate-mode app's Surface had any content — so it froze empty. Drive frame() from Widget.AddTickCallback (go-gtk v0.2.4): the GdkFrameClock ticks while the window is mapped, quiescent when not; syncNative reconciles controls by key, so ticking never rebuilds them. Proven end to end: go-news-reader -window under Xvfb now renders its full UI (topbar with the overlaid native GtkEntry search field, sidebar, item list, preview) at ~57fps through go-gtk/purego, CGO=0. Bumps go-gtk v0.2.1 → v0.2.4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GTK4-hosted window came up blank, on two counts:
GtkPicturewasPutinto theGtkFixedat 0,0 with no size; a GtkFixed gives each child its requested size, and a content-less GtkPicture requests 0×0 — so the framebuffer was laid out invisibly. Now sized to the logical window.Run()presented one frame, before the window was mapped (frame clock not started) and before an immediate-mode app's Surface had content — freezing empty. Now driven byWidget.AddTickCallback(go-gtk v0.2.4): the GdkFrameClock ticks while mapped, quiescent when not;syncNativereconciles controls by key, so ticking never rebuilds them or fights a caret.Proven end-to-end:
go-news-reader -windowunder Xvfb now renders its full UI (topbar with the overlaid native GtkEntry search field, sidebar, item list, preview) through go-gtk/purego, CGO=0. Bumps go-gtk v0.2.1 → v0.2.4.