Repository navigation
Add GTK4 + libadwaita interface (GTK_BUILD_TYPE=GTK4) - #1318
Conversation
Introduce a GTK4/libadwaita port of the GTK GUI alongside the existing GTK2/GTK3 interfaces, selectable with -DGTK_BUILD_TYPE=GTK4. GTK3 remains the default and is left untouched, so this change is purely additive. The new interface lives in src/interfaces/gtk4/ and is a full modernization, not a mechanical port: - Asynchronous dialogs throughout. GTK4 removed gtk_dialog_run(); every dialog is now build -> present -> respond, with shared helpers in ec_gtk4_dialogs.c (AdwAlertDialog, GtkFileDialog, AdwToast). - List views move from GtkTreeView/GtkListStore to GtkColumnView over a GListModel with a typed GObject item per view. This removes the hidden pointer column and the fragile GtkTreeIter-based deferred name resolution. - libadwaita widgets: AdwApplicationWindow, AdwToolbarView/AdwHeaderBar, AdwTabView (MDI pages), AdwAboutDialog, AdwToast, AdwShortcutsDialog (with a plain AdwDialog fallback for libadwaita < 1.8). - The keyboard-shortcuts window is generated from the accelerator table rather than the ~1370-line hand-written ec_gtk3_shortcuts.c. Build wiring: pkg-config-based FindGTK4.cmake, GTK_BUILD_TYPE=GTK4 in EttercapLibCheck.cmake (requires GTK >= 4.12 and libadwaita >= 1.5), a HAVE_GTK4 define, the source list in src/interfaces/CMakeLists.txt, and a 24.04-only entry in the CI matrix (older releases ship libadwaita < 1.5). A Cua-based test harness (tests/gtk4/) builds and drives the interface in an Ubuntu 24.04 cloud sandbox; its provision.sh doubles as the standalone build recipe and is shared with CI. README.md and INSTALL document the new dependencies and the GTK_BUILD_TYPE selection for packagers. Along the way this fixes some latent GTK3 bugs carried over during the port: the tab-page accelerators that never worked (the GTK3 "FIXME doesn't work yet"), a duplicate <Primary>p binding, and a mislabelled OS in the profile detail view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BH79eFmKHXYo6dYnQLcep
|
thank you! I tested and looks like working properly, but I have a question, on startup I can't see the "select interfaces", I don't know how to pass the interface properly, is it a bug? |
|
It's actually a bug. I'll be opening a PR to fix it. |
|
Follow-up (c4a8026): restored the network-interface picker on the setup I also diffed the GTK4 interface against GTK3 to make sure nothing else was |
|
Thanks for the thorough review, @koeppea — all four are real. The interface
All verified in the Cua sandbox harness ( |


Summary
Adds a GTK4 + libadwaita port of the GTK GUI, selectable with
-DGTK_BUILD_TYPE=GTK4. GTK3 stays the default and is left completelyunchanged — the GTK4 interface is a parallel tree under
src/interfaces/gtk4/, so this change is purely additive.Why now
GTK3 is in maintenance-only mode upstream, and recent GTK / glycin changes
have started to break the GTK3 interface in the field — see #1310, where
ettercap -Gcrashes after idle once glycin restarts its image loaders acrossthe privilege drop. This gives ettercap a modern, actively-supported toolkit
to move to. The move off GtkTreeView to GtkColumnView may also help with
long-standing rendering glitches some users hit on certain setups (#1231),
though that still needs confirmation from affected users on the new interface.
What's in it
A full modernization, not a mechanical port:
gtk_dialog_run(); everydialog is now build → present → respond, with shared helpers in
ec_gtk4_dialogs.c(AdwAlertDialog,GtkFileDialog,AdwToast).GtkTreeView/GtkListStoretoGtkColumnViewover a
GListModelwith a typedGObjectitem per view. This drops thehidden pointer column and the fragile
GtkTreeIter-based deferred nameresolution.
AdwApplicationWindow,AdwToolbarView/AdwHeaderBar,AdwTabViewfor the MDI pages,AdwAboutDialog,AdwToast, andAdwShortcutsDialog(with a plainAdwDialogfallback forlibadwaita < 1.8).
instead of the ~1370-line hand-written
ec_gtk3_shortcuts.c.Build wiring: a pkg-config-based
FindGTK4.cmake,GTK_BUILD_TYPE=GTK4inEttercapLibCheck.cmake,HAVE_GTK4, and a 24.04-only entry in the CI matrix.Requirements (for packagers)
AdwDialog/AdwAlertDialog). This gates the GTK4 build to Ubuntu ≥24.04 / Debian ≥ 13 / Fedora ≥ 39; older releases keep the GTK3 build.
README.mdandINSTALLdocument the dependencies and-DGTK_BUILD_TYPE=.Validation
Built and driven in an Ubuntu 24.04 cloud sandbox via the included harness
(
tests/gtk4/, see its README) — 5/5 checks pass: startup, the asyncdialogs, the generated shortcuts window, the about dialog, and the sniffing UI
with its
GtkColumnViewlist views populated from a fixture pcap, all with noGTK criticals logged.
Screenshots from that run are attached below (setup screen, sniffing UI, the






connections and profiles
GtkColumnViews with data, the generated shortcutswindow, and the
AdwAboutDialog).Notes for reviewers
tab-page accelerators that never fired (the GTK3
FIXME doesn't work yet),a duplicate
<Primary>pbinding, and a mislabelled OS in the profiledetail view.
(build wiring / dialog layer / individual views) if that's easier to land.
Related: #1310, #1231
🤖 Generated with Claude Code