Skip to content

gtk4-prep: replace GtkWidget.destroy vfunc with GObject.dispose - #21545

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
Arecsu:gtk4/no-destroy-vfunc
Jul 25, 2026
Merged

gtk4-prep: replace GtkWidget.destroy vfunc with GObject.dispose#21545
TurboGit merged 1 commit into
darktable-org:masterfrom
Arecsu:gtk4/no-destroy-vfunc

Conversation

@Arecsu

@Arecsu Arecsu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

GtkWidget.destroy vfunc override is removed in GTK4. The migration guide recommends using GObject.dispose instead.

Two custom widgets override the destroy vfunc:

  • gradientslider.c: _gradient_slider_destroy -> _gradient_slider_dispose
  • range.c: _range_select_destroy -> _range_select_dispose

Both now implement GObjectClass->dispose, take GObject * parameter, and chain to G_OBJECT_CLASS(parent_class)->dispose(object).

Related: "Stop using the GtkWidget.destroy vfunc" #15920 #20433

Stop using the GtkWidget.destroy vfunc

Instead of implementing GtkWidget.destroy, you can implement GObject.dispose.

https://docs.gtk.org/gtk4/migrating-3to4.html

`GtkWidget.destroy` vfunc override is removed in GTK4. The migration
guide recommends using `GObject.dispose` instead.

Two custom widgets override the destroy vfunc:
- `gradientslider.c`: `_gradient_slider_destroy` -> `_gradient_slider_dispose`
- `range.c`: `_range_select_destroy` -> `_range_select_dispose`

Both now implement `GObjectClass->dispose`, take `GObject *` parameter,
and chain to `G_OBJECT_CLASS(parent_class)->dispose(object)`.

Corresponds to the "Stop using the GtkWidget.destroy vfunc" section
of the GTK4 migration guide.
@ralfbrown ralfbrown added the gtk4 label Jul 14, 2026
@TurboGit TurboGit added this to the 5.8 milestone Jul 16, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@TurboGit
TurboGit merged commit 84db2bc into darktable-org:master Jul 25, 2026
5 checks passed
@Arecsu
Arecsu deleted the gtk4/no-destroy-vfunc branch July 25, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants