Skip to content

docs: add GTK4 porting guide - #258

Open
Inuth0603 wants to merge 1 commit into
sugarlabs:masterfrom
Inuth0603:add-gtk4-guide
Open

Inuth0603 wants to merge 1 commit into
sugarlabs:masterfrom
Inuth0603:add-gtk4-guide

Conversation

@Inuth0603

Copy link
Copy Markdown

This PR adds a new GTK4 Porting Guide at src/gtk4-porting-guide.md.

The guide documents the GTK4 migration issues I encountered while porting the Fructose activities during GSoC 2026. It is meant to be a practical reference for developers working on the remaining GTK4 ports, rather than a project retrospective.

The guide is based on the existing gtk3-porting-guide.md and covers the GTK3 → GTK4 changes that came up most often during the ports.

Included in the guide

  • A quick reference for commonly used GTK3 APIs and their GTK4 replacements.
  • Changes to containers and layouts, including pack_start/pack_end → append/prepend.
  • Using GTK4 event controllers instead of the older event signals, including notes on propagation phases.
  • Migrating custom drawing code to set_draw_func() and do_snapshot().
  • Handling Cairo and Pixbuf code after the removal of APIs such as Gdk.cairo_set_source_pixbuf.
  • Examples for gestures, clipboard and drag-and-drop, Wayland-related popup issues, and GStreamer paintable sinks.
  • Sugar-specific examples where the GTK4 API differs from the normal GTK migration path.

I have included code examples for the parts that were less straightforward during the migration, so developers can use the guide while working through an activity rather than having to figure out each change from scratch.

The PR also updates README.md to link to the new guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant