GTK4: Replace deprecated container, layout and display APIs#1092
Open
Dev10-sys wants to merge 2 commits intosugarlabs:gtk4-portfrom
Open
GTK4: Replace deprecated container, layout and display APIs#1092Dev10-sys wants to merge 2 commits intosugarlabs:gtk4-portfrom
Dev10-sys wants to merge 2 commits intosugarlabs:gtk4-portfrom
Conversation
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.
This patch updates several deprecated GTK3 APIs to GTK4 equivalents across the Sugar shell.
Main changes include replacing Gdk.Screen with Gdk.Display and monitor geometry with proper guards and fallbacks, migrating Gtk.Alignment to Gtk.Box using halign, valign and margin properties, replacing Gtk.EventBox with Gtk.Box where appropriate, and updating container APIs such as add, pack_start and show_all to GTK4 compatible methods like append, set_child and show or present.
Deprecated modify_bg and modify_fg usage was replaced with CSS providers, and get_children usage was updated to GTK4-safe child iteration patterns. Gtk.Dialog content handling was updated to use get_content_area(), and Gtk.Bin usage was replaced where necessary.
These changes are mechanical GTK4 migration changes and are not intended to change functionality, only to keep existing behavior working while moving the codebase toward GTK4 compatibility.