plugins: explicitly specify Gtk 3.0, Gdk 3.0, and GtkSource 4 typelib versions (#757) - #760
Open
ronitgupta138 wants to merge 2 commits into
Open
ronitgupta138 wants to merge 2 commits into
ronitgupta138 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The affected plugins request unavailable Xed 3.0 typelibs and fail before loading.
Review effort: Lite
Findings: 4
Open (4)
What changed in this PR
This PR pins GTK-related typelib versions to prevent GTK4 conflicts in the GTK3 Xed process.
Changes:
- Requires GTK 3.0 and Gdk 3.0 explicitly.
- Pins GtkSource, Peas, and Xed typelibs.
- Applies requirements across affected Python plugins.
| File | Summary |
|---|---|
plugins/textsize/textsize/documenthelper.py |
Adds explicit GTK and Gdk version requirements. |
plugins/textsize/textsize/__init__.py |
Adds GTK, Gdk, and Xed requirements; Xed 3.0 is unavailable and prevents loading. |
plugins/open-uri-context-menu/open-uri-context-menu/open-uri-context-menu.py |
Adds GTK, GtkSource, and Xed requirements; Xed 3.0 prevents loading. |
plugins/joinlines/joinlines/__init__.py |
Adds GTK and Xed requirements; Xed 3.0 prevents loading. |
plugins/bracket-complete/bracket-complete/bracketcompletion.py |
Adds GTK, Gdk, Peas, and Xed requirements; Xed 3.0 prevents loading. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| gi.require_version('Peas', '1.0') | ||
| #gi.require_version('Xed', '3.0') | ||
| from gi.repository import GObject, Gdk, Xed | ||
| gi.require_version('Xed', '3.0') |
| @@ -1,3 +1,6 @@ | |||
| import gi | |||
| gi.require_version('Gtk', '3.0') | |||
| gi.require_version('Xed', '3.0') | |||
| import gi | ||
| gi.require_version('Gtk', '3.0') | ||
| gi.require_version('GtkSource', '4') | ||
| gi.require_version('Xed', '3.0') |
| import gi | ||
| gi.require_version('Gtk', '3.0') | ||
| gi.require_version('Gdk', '3.0') | ||
| gi.require_version('Xed', '3.0') |
Author
|
Updated all |
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.

Fixes #757
Root Cause
When both GTK3 and GTK4 are present on a system, PyGObject without explicit
gi.require_version()calls defaults to the highest available typelib version (e.g.Gtk-4.0,Gdk-4.0). When libpeas loads Python plugins into the xed GTK3 process, loading the GTK4 typelib causes type registration collisions and locks the process at startup.Summary of Changes
gi.require_version('Gtk', '3.0')andgi.require_version('Gdk', '3.0')across all Python plugins (bracketcompletion,joinlines,open-uri-context-menu,textsize).gi.require_version('GtkSource', '4')toopen-uri-context-menu.XedandPeasversions are explicitly specified.