-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to gtk4 #1497
base: master
Are you sure you want to change the base?
Upgrade to gtk4 #1497
Conversation
I am getting this error and I don't know how to fix it: error: Package `libpeas-2' not found in specified Vala API directories or GObject-Introspection GIR directories
Compilation failed: 1 error(s), 0 warning(s)
[3/146] Merging translations for data/io.elementary.code.policy
FAILED: data/io.elementary.code.policy
/usr/bin/meson --internal msgfmthelper --msgfmt=/usr/bin/msgfmt data/io.elementary.code.policy.in data/io.elementary.code.policy xml /home/aitor/Bureau/code/po/extra
/usr/bin/msgfmt: Impossible de localiser les règles ITS pour data/io.elementary.code.policy.in
ninja: build stopped: subcommand failed. Since |
I've changed this to "draft" status as it will take more than changing the dependencies to port to Gtk4. Some code changes will be needed too. A lot of things were removed or changed between Gtk3 and Gtk4 (see https://docs.gtk.org/gtk4/migrating-3to4.html) Thanks for making a start though! I'll look into the libpeas issue and get back to you. |
It seems just about only Code uses libpeas amongst the Elementary projects. Files has similar plugins but just uses Taking this into account the best strategy for managing the migration is to identify what needs to be changed and as far as possible make incremental changes as separate PRs to the Gtk3 version that will minimize the diff when the port is actually done. |
Again, in the interest of small diffs, do not attempt to make unnecessary changes to the code while porting even if it could be improved. The first Gtk4 version should be as similar as possible to the Gtk3 version both in appearance and behaviour. After the port lands then we can set about incrementally taking advantage of Gtk4 features. |
Improving the performance of the code editor is a consubstantial side effect of the gtk4 migration as APIs have gotten better (async). But thanks for the tip anyway! I agree that PRs should be kept reasonable |
The relevant code in Files for the plugin system is: as well as the "plugin.vala" files in individual plugins in the |
I removed libpeas, upgraded all libraries, but there is still some package that's using gtk3 and conflicting: gtk4.vapi:15949.2-15949.46: error: `Gtk' already contains a definition for `tree_row_reference_deleted' |
I have raised a new issue re libpeas so that a separate PR can be proposed fixing it. See #1498 |
I'll pull your code and look into it. |
The culprit is the vte dependency. It should be |
Fixed, but how did you know that was the version you have to upgrade to? I looked for "vte github", "vte vala", "vte gtk4 migration", etc. |
If you search in Google for "vte 2.91 gtk4" its the first thing to come up. Or you can do |
In C++ you could soft migrate to gtk4 while still using gtk3 widgets. I see you can't do that in Vala. |
Probably to do with namespacing. There are many widgets with the same name in both libraries within the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrating the menus is something that can be split out and done in Gtk3
Nah, don't worry. It's easy to do. I can slice the PR in parts and explain all the changes here if you want. |
There needs to be people who are not egocentrical and help sustain this fantastical OS! But press me however you want, you won't discourage me :)
Plugins are fantastical, they help keep the main codebase tiny and organized! Plus, some marginal features (for instance Vim support) can be added without adding weight to the maintainers of the main product.
Making the changes itself is hard enough >:L |
libpeas-2.0 depends solely on glib, maybe it'd be easier to upgrade to it first? And remove |
True, but they also have drawbacks e.g. they only work when installed so you have to remember to do a I am not sure that code organization is a big deal - the symbol pane was migrated into main code from a plugin and now just reside in its own folder under However, you are probably right that specialist use plugins are best kept as such. I am talking about things that are commonly in use for a code editor. |
I agree, things like looking for a file in the Sidebar would be better off in the main code. Let's work on that after the port! |
meson can't find Available here in Valadoc: https://valadoc.org/libpeas-2/index.htm |
@kaixoo it's |
I did |
Agree. I am looking into it now. Need to ship a |
I have pushed a working draft of (Gtk3) migration of Code to libpeas-2. See #1501. Work to migrate this to Gtk4 over and above migrating the plugins themselves should be minimal. Note this branch will only compile on EOS8 so we cannot make another OS7.1 release once this is merged. |
libpeas-2 depends on glib >= 2.74, so gtk4. All the changes in this PR are ready I believe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please edit CI and Flatpak files to include the new dependencies?
Is there something missing here? bb33ca5 |
* feat: migrate DocumentView.vala drag-and-drop Replaced drag_received with drag_begin(Gtk.DragSource). Replaced Gtk.TargetEntry with GLib.Value * feat: migrate Sidebar.vala gtk drag-and-drop * feat: migrate MainWindow.vala Gtk.TargetEntry. TODO: Gdk.EventAny * feat: migrate Gtk.DragContext in SourceList.vala --------- Co-authored-by: kaixoo <[email protected]>
I couldn't find any info on how to migrate |
Looks like libgit2-glib-1.0-dev is missing |
Event handling is mostly done by adding You can see how I did it in Files at elementary/files#2082 but that branch is now redundant and not necessary the best example. |
Okay, I will be implementing all changes tomorrow |
I don't know how to migrate |
I've now succeeded in getting libpeas-2 to work in a flatpak (on OS8). So I am not sure whether it is best to keep libpeas for now as the PR is far less invasive. I'll have a look at this PR and try to create a branch that uses libpeas2. I'll also look into the SourceList problem. Maybe there is an alternative Gtk4 widget we could adopt? The trouble is a lot of Gtk4 widgets are sealed so difficult to customize so it would be best to keep the shipped SourceList until after the port. |
One thing that occurred to me about plugins in general is that afaik it is not possible to ship a separate flatpak containing extra plugins even if we wanted too which negates one of their advantages. |
If plugins cause more headaches than solutions, then fine, remove them. But VSCode does extensions fine in its flatpak version. |
I think we should keep libpeas for now to focus on the Gtk4 port. |
@leonardo-lemos Yes, I was coming to that conclusion. I have closed the other PR for now. |
469d2d6
to
923fc28
Compare
* First compilable version * Emulate previous appearance of Plugins view * Update ci.yml * Update io.elementary.code.yml * Bump glib dependency for libpeas-2 * Rename non-functional Flatpak manifest * Sync checkbutton with plugin loaded on show * Action when checkbox toggled * Fix double parenting * Sort plugins by name * Use bind_model and factory * Lose unused entities * Cleanup and code style * Fix initial appearance of preferences dialog * Add some comments * Lose commented out code * Make activate and deactivate methods mandatory to implement * Fix Flatpak build for OS8 * Fix ci.yml * Add libgit2-glib-1.0-dev to ci.yml * Split SourceList into one file per class * Fix changed namespace * Remove DnD code * Replace Gdk.EventKey * Use GestureClick * Handle showing context menu * Handle search_entry focus in * Handle window close request
Run other things (i.e. file treeview) asyncTODO: