Skip to content

gtk2-clean branch — remove GTK2/libglade support - #1379

Merged
karlkleinpaste merged 4 commits into
crosswire:masterfrom
LAfricain:gtk2-clean
Aug 16, 2026
Merged

gtk2-clean branch — remove GTK2/libglade support#1379
karlkleinpaste merged 4 commits into
crosswire:masterfrom
LAfricain:gtk2-clean

Conversation

@LAfricain

Copy link
Copy Markdown
Contributor

GTK3/GtkBuilder has been the only actively-built configuration for a
while (no CI job builds with GTK2=ON), but the GTK2/libglade code
path was still present throughout the codebase as dead weight.

What changed

  • CMake: removed the GTK2 option and every conditional branch
    depending on it (XiphosOptions, XiphosDependencies,
    XiphosConfig_h, XiphosReport, src/gtk/CMakeLists.txt,
    win32/CMakeLists.txt, ui/CMakeLists.txt). USE_GTK_3 /
    USE_GTKBUILDER are now unconditionally set.
  • Source (16 .c files + 2 headers): dropped every
    #ifdef USE_GTKBUILDER / #else (libglade) / #endif branch, keeping
    only the GtkBuilder code path. Also found and removed a few bits of
    genuinely dead code along the way:
    • search_dialog.c: a libglade-only helper function that could
      never actually compile once USE_GTKBUILDER became unconditional
    • a couple of commented-out glade_xml_get_widget() leftovers
    • webkit_editor.c: the gtk2_webedit.ui selection branch
  • UI files: removed the 11 remaining .glade files (all had a
    .gtkbuilder equivalent already in use) and gtk2_webedit.ui. Also
    fixed xi-export-bookmarks.glade, the one file that had never
    actually been converted despite already loading fine via
    GtkBuilder.

Verified

I tested the windows build. Works perfectly.

Left for later (up to you @greg-hellings )

USE_GTKBUILDER itself (in XiphosConfig_h.cmake /
config.h.cmake.in) is now always ON and no longer tested anywhere
in the C code — could be removed too, but left alone for now since it
doesn't hurt anything as-is.

lafricain79 added 4 commits August 10, 2026 22:09
xi-export-bookmarks.glade was the only .glade file without a matching
.gtkbuilder counterpart. Turns out export_bookmarks.c never actually
used the libglade API on it in the first place — it already loads it
via gtk_builder_new()/gtk_builder_add_from_file() unconditionally.

Renamed the file to .gtkbuilder (its content was already valid
GtkBuilder XML) and removed the dead #ifndef USE_GTKBUILDER include
of <glade/glade-xml.h>, which was never reachable.
GTK2/libglade support is gone; GTK3 is now the only supported
toolkit. Removes the GTK2 option declaration and every conditional
branch that depended on it:

- XiphosOptions.cmake: drop option(GTK2) and its WEBKIT1 implication
- XiphosDependencies.cmake: keep only the GTK3 pkg-config branch
  (WEBKIT1/GTKHTML combinations unchanged); drops the GTK2 branch
  and the now-orphaned gtk+-unix-print-2.0 check
- XiphosConfig_h.cmake: USE_GTK_3/USE_GTKBUILDER are now always set
- XiphosReport.cmake: build summary always reports Gtk+-3.0
- src/gtk/CMakeLists.txt: drop the dead Unix-print link block
  (Unix-print_FOUND can no longer be set)
- win32/CMakeLists.txt: install only the GTK3 DLLs/shared files
USE_GTKBUILDER is now always defined (GTK2 option removed from
CMake). Drop every #ifdef USE_GTKBUILDER / #else (libglade) / #endif
branch across the 16 .c files and 2 headers that had them, keeping
only the GtkBuilder code path. Also removes a couple of small dead
code blocks found along the way:

- export_dialog.c: obsolete pieces already unreachable
- search_dialog.c: _create_mod_sel_dialog(), a libglade-only helper
  that was never compiled once USE_GTKBUILDER became unconditional
- menu_popup.c, navbar_versekey_parallel.c: dead commented-out
  glade_xml_get_widget() reference blocks

Build verified with GTKTVEDITOR=ON WEBKIT1=ON CONSOLE=OFF.
- webkit_editor.c: USE_GTK_3 always defined now, so gtk_webedit.ui is
  always used; drop the dead gtk2_webedit.ui branch
- mod_mgr.c: update stale comment referencing module-manager.glade
- ui/CMakeLists.txt: install only the GTK3 .gtkbuilder files,
  un-conditioned; drop gtk2_webedit.ui
- remove all remaining .glade files (bookmarks, editor_link_dialog,
  export-dialog, folder, markverse, module-manager, navbar_versekey,
  prefs, search-dialog, selector-prefs, xi-menus) — every one has a
  .gtkbuilder equivalent that's actually loaded, and nothing
  references the .glade files anymore
@karlkleinpaste
karlkleinpaste merged commit 8a98039 into crosswire:master Aug 16, 2026
7 checks passed
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.

2 participants