Skip to content
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

🧊 Migrate to GTK4 #90

Open
5 of 9 tasks
vemonet opened this issue Apr 10, 2023 · 4 comments
Open
5 of 9 tasks

🧊 Migrate to GTK4 #90

vemonet opened this issue Apr 10, 2023 · 4 comments

Comments

@vemonet
Copy link
Collaborator

vemonet commented Apr 10, 2023

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 #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:

  • 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)
  • Right click to append emojis to the clipboard works
  • Search works
  • Hovering emojis works
  • 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:

@vemonet vemonet mentioned this issue Apr 10, 2023
4 tasks
@mijorus
Copy link

mijorus commented Apr 17, 2023

@vemonet what's the current state of this port? do you need any help?

@vemonet
Copy link
Collaborator Author

vemonet commented Apr 18, 2023

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. #89 for more details)

@tom-james-watson
Copy link
Owner

@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!

@mijorus
Copy link

mijorus commented Apr 18, 2023

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.

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

No branches or pull requests

3 participants