Skip to content

Migrated Tilix from GtkD to GID bindings#2282

Open
dejlek wants to merge 6 commits into
gnunn1:masterfrom
dejlek:dejan/tilix-on-gid-gtk3
Open

Migrated Tilix from GtkD to GID bindings#2282
dejlek wants to merge 6 commits into
gnunn1:masterfrom
dejlek:dejan/tilix-on-gid-gtk3

Conversation

@dejlek

@dejlek dejlek commented Jan 18, 2026

Copy link
Copy Markdown

Tilix Migration: GtkD to GID Bindings

This PR completes the migration of Tilix from gtk-d bindings to gid (GObject Introspection D) bindings version 0.9.7.

(This is a natural step towards making Tilix work on top of GTK4 - gid:gtk4 and gid:vte3 are already having everything needed for that migration.)


Overview

The migration involved 72 tasks across 12 phases, converting the entire codebase to use the newer GID bindings which provide better GObject introspection support.

Scope of Changes

Files Modified: 29 source files

Import Conversions:

  • ~400 GTK imports (gtk.*gtk.snake_case)
  • ~100 GIO imports (gio.*gio.snake_case)
  • ~100 GLib imports (glib.*glib.snake_case)
  • ~70 GDK imports
  • ~35 GObject imports
  • ~15 VTE imports
  • ~10 Cairo imports
  • ~5 Pango imports

Signal Handler Conversions: 193 handlers converted from addOn* to connect* pattern

Dependencies Changed:

  • Removed: gtk-d:* packages
  • Added: gid:gtk3, gid:vte2, gid:gdk3, gid:gio2, gid:glib2, gid:gdkpixbuf2, gid:pango1, gid:pangocairo1, gid:cairo1, gid:secret1 (all version 0.9.7)
  • Removed in-tree secret module (replaced by gid:secret1)

Key Changes by Phase

Phase 1-6: Project Setup & Core Infrastructure

  • Updated dub.json with GID dependencies
  • Migrated core utility modules (gx.gtk.*)
  • Converted low-level C bindings from gtkc.* to *.c.functions/*.c.types

Phase 7-8: Tilix Application & Terminal

  • Migrated main application modules (application.d, appwindow.d, session.d)
  • Migrated terminal module (terminal.d - most complex file with 50+ imports and 50+ signal connections)
  • Converted password storage to use gid:secret1

Phase 9: Preferences & Bookmarks

  • Migrated preferences editor and profile editor
  • Migrated bookmark management modules

Phase 10: Testing & Bug Fixes

  • Fixed VTE palette colors (all black issue)
  • Fixed GID 0.9.7 getStrv() bug that returned only 1 element
  • Fixed profile editor crash (invalid Editable→Entry cast)
  • Fixed title bar variable substitution
  • Fixed "Add terminal" button icons and enabled state
  • Fixed F11 fullscreen shortcut
  • Fixed various null event crashes in signal handlers
  • Fixed dialog button labels (C string handling)

Phase 11-12: Documentation

  • Updated README.md with new build instructions
  • Created comprehensive GTKD-TO-GID-NOTES.md with 62 sections documenting migration patterns

Build Instructions

Compiler Requirement: GDC (GNU D Compiler) is required.

# Build
dub build --compiler=gdc --build=release

# This script will copy files to the right places, make gschemas.compiled etc.
./install.sh

# Run (during development)
GSETTINGS_SCHEMA_DIR=$(pwd)/schemas ./tilix

Testing Summary

Feature Status
Application startup ✓ Working
Terminal emulation ✓ Working
Keyboard input ✓ Working
Color schemes/palette ✓ Working
Copy/paste ✓ Working
Split terminals ✓ Working
Session tabs ✓ Working
Session save ✓ Working
Preferences dialog ✓ Working
Profile management ✓ Working
Keyboard shortcuts ✓ Working
Password storage ✓ Working
X11 features ✓ Working
Bookmark creation ✓ Working

Known Issues

  1. Session Load/Switch Edge Case

    • Loading a saved session works, but switching to the loaded session via sidebar sometimes causes the app to wait in ppoll (appears frozen)
    • Workaround: Create new sessions instead of loading saved ones, or use keyboard shortcuts to switch
    • Root cause: Event handling issue specific to loaded sessions needs deeper investigation
  2. Bookmark Chooser Crash

    • The bookmark chooser dialog crashes when bookmarks exist in the tree
    • The crash occurs in GTK's internal gesture handling code with no D code in the backtrace
    • Workaround: Users can create bookmarks via "Add Bookmark..." and edit ~/.config/tilix/bookmarks.json directly
    • Root cause: Appears to be a GID binding issue that requires deeper investigation
  3. GLib-GObject-CRITICAL Warnings

    • Non-fatal warnings appear: g_value_get_pointer: assertion 'G_VALUE_HOLDS_POINTER (value)' failed
    • These are pre-existing GID binding issues, not specific to this migration
    • The warnings don't affect functionality
  4. Wayland/Flatpak Not Tested

    • Wayland compatibility - skipped as I do not have Wayland here.
    • Flatpak host-command spawning - skipped
    • These should be tested separately if Wayland/Flatpak support is needed

Migration Documentation

A comprehensive migration guide has been created in GTKD-TO-GID-NOTES.md covering:

  • Import path naming conventions
  • Signal connection patterns
  • Enum naming changes
  • Constructor differences
  • C API fallback patterns
  • GID 0.9.7 specific bugs and workarounds
  • Platform-specific considerations

This document serves as a reference for future GtkD to GID migrations.


Credits

Complete migration of Tilix terminal emulator from gtk-d bindings
to gid (GObject Introspection D) bindings version 0.9.7.

- Migrated 29 source files with ~400 GTK, ~100 GIO, ~100 GLib imports
- Converted 193 signal handlers from addOn* to connect* pattern
- Replaced in-tree secret module with gid:secret1
- Added workarounds for GID 0.9.7 bugs (getStrv, VTE setColors)
- Created comprehensive migration documentation (GTKD-TO-GID-NOTES.md)
- Updated build to require GDC compiler
- All core functionality tested and working
@dejlek dejlek force-pushed the dejan/tilix-on-gid-gtk3 branch from 19c775a to b857b74 Compare January 18, 2026 18:39
@dejlek

dejlek commented Jan 18, 2026

Copy link
Copy Markdown
Author

Keep in mind that you will most likely have to run the following if you want to try it locally:

./install.sh $HOME/.local
GSETTINGS_SCHEMA_DIR=$(pwd)/schemas ./tilix

First line copies Tilix gresource file to ~/.local/share/tilix/resources, second line tells Tilix where to find the compiled gschemas.

We can create a "local" dub config and in the post build step of that config run these two commands. I could not bother doing this...

@dejlek

dejlek commented Jan 24, 2026

Copy link
Copy Markdown
Author

@ximion , could you please check this out. I know it is a huge PR but this is really important if we want to move further and eventually have Tilix run on GTK4...

@ximion

ximion commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator

This is a ton of work, thank you for doing it!

Some basic questions first: Why is GID better than GtkD / why should this switch happen? Is GtkD abandoned or obsolete? In order to keep Tilix in Linux distros easier, could GID add Meson support (and have that in turn plumbed up with Tilix)? Creating static libraries for GID with Meson to work around ABI instability is fine, but Meson is still way easier to handle for distros than dub is.

@dejlek

dejlek commented Jan 28, 2026

Copy link
Copy Markdown
Author

Thank you for having a look!
Ping me on IRC (Dejan) when you see me (I assume you are ximion on IRC, right?) or even better - join the giD discord: https://discord.gg/SxJQkrcBs2
We can have a chat about all this.

@ximion

ximion commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Yes, but not too soon, unless you are on your way to FOSDEM like me right now and we talk there :-) (during the conference and while traveling, I will definitely not be online much).

@gwelr

gwelr commented Apr 4, 2026

Copy link
Copy Markdown

Any advance in this PR ? Bindings for GTK 4 would be nice and I'm suspect gtkD does not support GTK4.

@dejlek

dejlek commented Apr 21, 2026

Copy link
Copy Markdown
Author

After discussion with @ximion I realised that in order to make this change accepted by the Debian and Fedora there is much more work that would be needed - each gid:subpackage would need to be turned into a separate Debain/Fedora/etc package - something I just do not have time and will to work on, especially considering I do not use Tilix. I use DTerm, a GTK4 terminal, again in D, I have been working on for quite some time. Most likely this many-days work was for nothing. Sad but true.

@ygrek

ygrek commented Apr 21, 2026

Copy link
Copy Markdown

but debian work is on debian maintainers, this shouldn't influence this project decisions

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.

4 participants