gtk2-clean branch — remove GTK2/libglade support - #1379
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GTK3/GtkBuilder has been the only actively-built configuration for a
while (no CI job builds with
GTK2=ON), but the GTK2/libglade codepath was still present throughout the codebase as dead weight.
What changed
GTK2option and every conditional branchdepending on it (
XiphosOptions,XiphosDependencies,XiphosConfig_h,XiphosReport,src/gtk/CMakeLists.txt,win32/CMakeLists.txt,ui/CMakeLists.txt).USE_GTK_3/USE_GTKBUILDERare now unconditionally set..cfiles + 2 headers): dropped every#ifdef USE_GTKBUILDER / #else (libglade) / #endifbranch, keepingonly 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 couldnever actually compile once
USE_GTKBUILDERbecame unconditionalglade_xml_get_widget()leftoverswebkit_editor.c: thegtk2_webedit.uiselection branch.gladefiles (all had a.gtkbuilderequivalent already in use) andgtk2_webedit.ui. Alsofixed
xi-export-bookmarks.glade, the one file that had neveractually 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_GTKBUILDERitself (inXiphosConfig_h.cmake/config.h.cmake.in) is now alwaysONand no longer tested anywherein the C code — could be removed too, but left alone for now since it
doesn't hurt anything as-is.