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

🙏 Gnome 45 ECMAScript #12

Merged
merged 19 commits into from
Nov 19, 2023
Merged

🙏 Gnome 45 ECMAScript #12

merged 19 commits into from
Nov 19, 2023

Conversation

FelipeFTN
Copy link
Owner

@FelipeFTN FelipeFTN commented Sep 25, 2023

🌱 Working on a Gnome 45 port to ECMAScript

This pull request is following this documentation: gjs.guide.
Related issue: #11

These changes main focus just the imports. Please ignore the minor changes over the file, like indentation or removing comments.

@FelipeFTN FelipeFTN added the 💯 enhancement New feature or request label Sep 25, 2023
@FelipeFTN FelipeFTN self-assigned this Sep 25, 2023
@FelipeFTN FelipeFTN mentioned this pull request Sep 25, 2023
@FelipeFTN FelipeFTN linked an issue Oct 12, 2023 that may be closed by this pull request
@mbeps
Copy link

mbeps commented Oct 14, 2023

@FelipeFTN Is this ready and fully functional?

@FelipeFTN
Copy link
Owner Author

Hey @mbeps! I just downloaded and Installed the Gnome 45 Nightly here. 💯
I'm testing and fixing some bugs. This feature is not ready to be merged yet, but I will do my best to finish it as soon as possible! 🚀

@mbeps
Copy link

mbeps commented Oct 15, 2023

@FelipeFTN Awesome. Keep up the good work.

@FelipeFTN
Copy link
Owner Author

FelipeFTN commented Oct 16, 2023

@hardfalcon Thanks a lot, buddy! 😃 👍
I will be applying these changes and others from now. I'm reading the docs, and it seems like using Adw library will make prefs.ui deprecated, needing to be rebuilt using GTK & Adw libraries. 👀
I hope this is not necessary. If that's how I think, then we would need to refactor the prefs.ui completely. 😔
Because the ExtensionPreferences thing would change the builder parameter, and the builder.get_object('get-from-prefs.ui') function would not work anymore. 😬

Anyways, you helped a lot! Please feel free to do more! 😄

@Rmano
Copy link

Rmano commented Nov 13, 2023

Very nice, thank you! I'll test it as soon as it goes to extensions.org on my Manjaro!

@wolfgang101
Copy link

Please ignore my unsolicited feedback if this is intended behavior.

Pulled the "finished gnome-45" commit and I can enable the extension and see the app indicator icon in the gnome system bar. Can click on it and search for emojis as usual.

There currently is no way to customize the extension. Normally I hide the app icon from the system bar and use a shortcut to open the app.

Hope this is just a minor glitch and we can get back full functionality soon.
Anyways... thank your for your work!

@FelipeFTN
Copy link
Owner Author

FelipeFTN commented Nov 13, 2023

Thank you so much for the support, you guys are amazing! 🤩
@Rmano you can git clone the repo on this branch and run sh install.sh. This will allow you to automatically install and use the gnome-45 version! (don't forget to restart your display manager, Xorg or Wayland, so it will detect the new extension installed).
Also, be caught to the Extensions to not auto-update the gnome-extensions and downgrade to the gnome-44 version. The better way I found to avoid it was by changing the UUID on the metadata.js to one that doesn't exist: latest-emoji-copy@felipeftn. 🎉

@wolfgang101 Thank you!! I'm working on fixing some tiny bugs and polishing the code now. Soon, I will have the last commit on this PR and merge it!
Can you please help me with something? Did your extension have a bug when starting? For example, when you click on the emoji icon or try to open the panel, it doesn't work unless you disable and enable the extension?
Also, you are right, the settings menu is not a glitch at all 😅
I had to disable it, so I could work on the extension migration without any issues.
The prefs.js (where the settings are stored) was causing a lot of issues during the migration. I will be reworking on it!
But don't worry, there is still a way to change your settings! You can change it manually directly for the gschema.xml file until I work on the new prefs! 🥳

@wolfgang101
Copy link

wolfgang101 commented Nov 13, 2023

@FelipeFTN I'm on an X11 session on Ubuntu 23.10. Since the recent dist upgrade I have the problem that hitting ALT+F2 and then "r" to restart the gnome shell it generally crashes the shell and it forces me to log out and back in again.

I noticed that after one log in I could not click the emoji icon. Had to disable and re-enable the extension and it worked nicely again.

I was able to alter the schema file and it hid the tray icon. Key binding never worked though, even though it was enabled.

Edit: Nevermind the key binding. I typically set it to SUPER+E and the comments in the schema file said SUPER+E too, but the actual default binding is the SUPER+period. I changed it back to SUPER+E and works flawlessly.

@FelipeFTN
Copy link
Owner Author

FelipeFTN commented Nov 13, 2023

@wolfgang101 Thanks for the feedback!
I'm completely aware of these problems, but I have no idea what is causing it. 😵

I've tested on Xorg and Wayland, both are getting the same error (needing to restart the extension to work).
As for the Shell Crash after ALT+F2 + "restart", it's happening here too!
I've added tons of logs already, but everything looks to work properly, the extension just doesn't open at start.
I just sent a message for help on Gnome Extensions IRC, but no answer yet.
My next approach will be to try to crash the gnome shell again by restarting it on X11, and get the error logs, to see If I got any error message telling what went wrong with the extension.

If someone knows how to fix it, or could look at the code and identify the error, I will be so glad! ✨

I will be debugging it and try to solve it as soon as possible.
Also, I have some tricks for debugging the extension, let me share with you:
Running this command dbus-run-session -- gnome-shell --nested --wayland will open a new session on your computer (it will open a window, just like a VM), and you will be able to test the extension without needing to restart your session (logging out) - The extension must be installed before running the command.
Inside that VM, you just need to open your terminal and activate the extension: gnome-extensions enable emoji-copy@felipeftn.
I also noticed that, in order to get the extension working inside the VM, you can just restart the gnome-extensions directly from terminal: gnome-extensions reset emoji-copy@felipeftn && gnome-extensions enable emoji-copy@felipeftn.
UPDATE: Some part of the code that has this.emojiCopy = Extension.lookupByUUID("emoji-copy@felipeftn"); you need to change the uuid name too.
I saved all the instructions in the debug.md file.

I will keep my eyes on these problems, and will try to fix them! 🚀

@wolfgang101
Copy link

Thank you for sharing more infos on debugging. The extension restart will definitely come in handy.

I did not mean to imply that the extension is causing the gnome shell crash. At least on my system with the extension completely removed the shell is crashing after ALT+F2 + R. More likely that it's just some general issue not related to the extension.

@Rmano
Copy link

Rmano commented Nov 13, 2023

@wolfgang101 @FelipeFTN About the crash with the gnome-shell restart in X11: it's a known bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7050 (developers don't seem to be especially worried about it...). It does not happen if you close all your windows before restarting (yes, I know, sort of useless... you can also log out and in at that point).

@FelipeFTN
Copy link
Owner Author

🥳 Problem Solved, Guys! 🎉
Please, test the latest commit on your machines and report any broken stuff I missed! 😅
I will be sending the gnome-45 version for review on GNOME Extensions, as soon as it gets accepted I merge this PR, and we are done here!! 🙏
Thank you all for the big help!! 🚀

@wolfgang101
Copy link

Thank you so much for your work @FelipeFTN !
I'm so happy that I can use the extension again.

Pulled your latest changes. Did not do a lot of additional testing, but so far it worked nicely on my machine. Including setting custom settings via schema file.

If you publish it on gnome extensions without preferences dialog you definitely should put some WIP info right into the description on gnome.org to avoid support requests :)

@Rmano
Copy link

Rmano commented Nov 13, 2023

One thousand thanks! I won't be able to check it before Wednesday afternoon (Europe time) but rest assured I'll do it and report back!

@wolfgang101
Copy link

wolfgang101 commented Nov 14, 2023

@FelipeFTN Can you replicate selecting the emoji by key press (Enter key) not working / or being wonky? It does not work on my machine. Only mouse button press.

So far I've found that if I immediately fire the desired behavior (replaceClipboardAndClose in my case) on line 102 and skip the modifier detection completely it works just fine. Looks like the modifier detection does not work correctly anymore?

Have to stop for today and not sure how to debug in a meaningful way... basically how to get some console output. Hope my digging at least helps.

@Rmano
Copy link

Rmano commented Nov 15, 2023

Ok, I tried it. I can confirm that basically it works 🎉.

Glitches:

  • there are no options (and I am not convinced that the "auto-paste" works for me; I think I prefer to have the emoji in the copy buffer and do the paste in a second step. I tried to change the default value in the schema, but activating and reactivating the extensions seems not to be sufficient. I suppose it will work after the next login)
  • I can confirm that the "enter" key works... strangely. Sometimes pastes several emoji, sometime it does really strange things: the following images are after trying with banana+ enter, the other with sad + enter:

image

image

(you can see what has been pasted by looking at the clipboard manager).

@FelipeFTN
Copy link
Owner Author

Hello guys! Thank you for the feedback! ❤️
I just changed the timeout calls a bit, hope these changes works well for you!
For me it worked flawlessly now!! 🚀

@Razer0123
Copy link

Hello guys! Thank you for the feedback! ❤️ I just changed the timeout calls a bit, hope these changes works well for you! For me it worked flawlessly now!! 🚀

Thanks Felipe

When can we expect a new release on the Gnome store?

@FelipeFTN
Copy link
Owner Author

@Razer0123 Should be really soon! I've sent the new Gnome 45 release for Gnome Store to review, they usually take a couple of days, and since it's a huge new release, it's normal for them to take some time.
Unfortunately, I can't say a day for the official release at the store yet.
Also, they might ask for some minor changes in the code before releasing it. But I will keep you guys updated! ✨

@wolfgang101
Copy link

@FelipeFTN the changes to the timeout calls are quite noticable. Works really really great now! Thank you so much! ❤🎉

@Rmano
Copy link

Rmano commented Nov 17, 2023

Yes, it works better. Still I didn't manage to change the "auto-paste" flag to false (I edited it in the schema XML file and restarted... should I manually recompile the schema?). dconf-editor is not able to find any schema, it seems:

image

I have to admit that I didn't manage to add options for my extension (but I'll try!). A nice one that I often use to get inspiration (ejem) is lock keys.

@FelipeFTN
Copy link
Owner Author

@Rmano Thank you, buddy! Yes, I think you might have to recompile the schema, before applying the extension on your machine! Keep me updated if you got any result!

@FelipeFTN
Copy link
Owner Author

FelipeFTN commented Nov 18, 2023

Hello Friends!! Great day! Emoji Copy for GNOME 45 is now available on the Gnome Store! 🎉 🥳
Thank you so much for your support! You guys can be sure I learned more from you than the opposite! 🫂
I will be merging this PR soon and will keep working on new features and things to move Emoji Copy Extension Forward! Feel free to open issues and discussions in any need! Thank you so much! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💯 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gnome 45 support?
6 participants