Emote
Emote copied to clipboard
🧊 Migrate to GTK4
It would be interesting to migrate Emote to use GTK4 instead of GTK3 (without changing the UI as much as possible). This would enable access to newer features proposed by GTK4 (maybe a better integration to wayland?), and hopefully also improve performance. Migrating to GTK4 might also be a good opportunity to see if we can incorporate more of the nice features proposed in https://github.com/tom-james-watson/Emote/issues/20
Luckily https://github.com/mijorus/smile already uses GTK4, and is a good source of inspiration to understand some of the changes we need to do!
I managed to get a proof of concept running using GTK4:
- [x] Left click to select one emoji and copy it to clipboard works, and it works on wayland with the GTK clipboard (auto-paste also works on X11)
- [x] Right click to append emojis to the clipboard works
- [x] Search works
- [x] Hovering emojis works
- [x] Emojis are properly updating with the skintone selected
- [ ] A lot of the focus controllers still need to be fixed to work really smoothly (click out of application, keyboard navigation...)
- [ ] Margins and positioning of some windows could be improved
- [ ] The colors used in the skintone picker need to be fixed
- [ ] Welcome window need to be fixed
It is in a promising state, and should not be too hard to polish from there. It will probably need a few hours to test and solve everything, especially to fix all the events handlers and UI margins/sizes
You can try it from my fork branch migrate-to-gtk4: https://github.com/vemonet/Emote/tree/migrate-to-gtk4
Here is some helpful documentation:
- https://docs.gtk.org/gtk4/migrating-3to4.html
- https://pygobject.readthedocs.io/en/latest/
@vemonet what's the current state of this port? do you need any help?
Hi @mijorus, thanks for asking! Smile was a great help for working on this migration 🙂 I did not get much free time to work on it this week, and I will be out of the grid for the next 3 weeks
Currently it builds, shows up, and work, but there are still a lot of small improvements to do to have something as nice as the GTK3 version:
- [ ] Some of the focus controllers still need to be fixed to work really smoothly (closing when click out of application)
- [ ] Keyboard navigation in the app need to be fixed
- [ ] Margins and positioning of some windows could be improved
- [ ] The colors used in the skintone picker need to be fixed
I don't think there is anything in this list that is not doable in a few hours of work, but if you have some time to take a look I think the trickiest will be to update the keyboard navigation (here I think: https://github.com/vemonet/Emote/blob/migrate-to-gtk4/emote/picker.py)
Otherwise the main road block currently is to automatically add the flatpak package to the startup applications, any idea how we could achieve this? (cf. https://github.com/tom-james-watson/Emote/pull/89 for more details)
@mijorus: great job on Smile - it's awesome! Also a nice touch to acknowledge Emote too. Moments like this are where open source is at its best ❤️.
I'm also happy to help out with gtk4. Not worked with it before but I don't mind digging in. Though no promises - pretty busy with life stuff at the moment too. I think I'd prefer to do that once flatpak is merged though so there's not too many things in motion at once. Not a problem that you look at it in the meantime though!
Thanks @tom-james-watson
The biggest problem porting Smile was with the way gtk4 handles events, I'm looking at the code right now to spot any possible friction point.