Skip to content

Instantly share code, notes, and snippets.

@mjakeman
Created October 25, 2022 16:27
Show Gist options
  • Select an option

  • Save mjakeman/d632e52a8679eec4025602b2457a8f92 to your computer and use it in GitHub Desktop.

Select an option

Save mjakeman/d632e52a8679eec4025602b2457a8f92 to your computer and use it in GitHub Desktop.

Revisions

  1. mjakeman created this gist Oct 25, 2022.
    37 changes: 37 additions & 0 deletions inkscape-gtk4.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    # Inkscape GTK 4 Port
    What needs to be done?

    _GTK3 Backport Branch: https://gitlab.com/firox263/inkscape/-/tree/gtk4-prep-events_
    _GTK4 Transition Branch: https://gitlab.com/firox263/inkscape/-/tree/gtk4_

    ## Pre-Switch
    * Replace all direct uses of GdkEvent
    * Try move to event controllers where possible (not easy because GtkGestureClick doesn’t exist in GTK 3, which is basically all uses in Inkscape)
    * Stop using generic containers (should be fine, only toolbars which currently use it)
    * There are no deprecated structures in Inkscape!
    * Well, almost…
    * Need to migrate away from a few properties like use-stock

    ## Switch
    * Adapt to GdkEvent name/type changes
    * It is no longer a union, so changes needed
    * Adapt to libsigc++ changes
    * Seems to be ridiculously more verbose for some uses
    * How to keep static type parameters while keeping it readable?
    * Adapt to drag and drop changes
    * New API is much more sanely designed
    * How much does Inkscape use drag and drop?

    ## Post-Switch
    * Probably move from GtkEventControllerLegacy to the relevant event controllers like GtkGestureClick and what not
    * Touch support for free!
    * Move from deprecated GtkTreeView and friends to new fancy list widgets
    * Enable OpenGL canvas drawing and/or use GtkSnapshot

    ## Questions
    * Platform support
    * GTK4 on Windows… rough (worse than GTK3, but seems pretty active)
    * GTK4 on macOS… great-ish (much better than GTK3, although see [gtk!4523](https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4523))
    * Gtkmm is being deprecated (see: [gtkmm#110](https://gitlab.gnome.org/GNOME/gtkmm/-/issues/110))
    * Write more or less gtkmm code?
    * libadwaita? 👀