gnome-shell-extension-espresso icon indicating copy to clipboard operation
gnome-shell-extension-espresso copied to clipboard

GNOME 46 compatibility

Open ajbucci opened this issue 10 months ago • 7 comments

fixes #63

ajbucci avatar Apr 18 '24 18:04 ajbucci

These two changes provide a very barebone ability for Espresso to work partially with Gnome 46, but even basic things like clicking on the icon to enable or disable Espresso aren't working. Changing the extension widget from an Actor to a Child seems to affect the event handler.

coadmunkee avatar Apr 20 '24 16:04 coadmunkee

Strange. Everything is working as expected on my end. All the _connect's are initialized without error, when I toggle the icon on/off I appropriately get:

Espresso: Debug: Toggle enabled. Previous state was on user     override
Espresso: Debug: Removing all inhibitors
Espresso: Debug: Requested to remove inhibition by Symbol(espresso/user)
Espresso: Debug: Locking the queue and requesting to remove Symbol(espresso/user)
Espresso: Debug: Inhibitor removed: Symbol(espresso/user), unlocking queue
Espresso: Debug: Toggle enabled. Previous state was off     override
Espresso: Debug: Requested to add inhibition by Symbol(espresso/user)
Espresso: Debug: Locking the queue and requesting to add Symbol(espresso/user)
Espresso: Debug: addInhibit called with Symbol(espresso/user)
Espresso: Debug: Inhibitor added: Symbol(espresso/user), unlocking queue

I can also see the inhibitor being added and removed as expected on DBus monitor and I've verified that it prevents my PC from sleeping if enabled, and allows my PC to sleep when disabled.

I'm on Gnome 46 / X11 / Arch.

ajbucci avatar Apr 20 '24 19:04 ajbucci

Maybe something else is messed up on my linux install.... I'll build a fresh machine and do some more testing. Thanks for the work and the details on how it is working for you.

coadmunkee avatar Apr 20 '24 19:04 coadmunkee

No problem! Happy to help

ajbucci avatar Apr 20 '24 23:04 ajbucci

I tried this and it worked on Ubuntu 24.04 LTS.

I am not familiar with gnome-shell-extensions but here what I did.

  1. Clone the source ajbucci:master somewhere.
  2. Remove original from extensions rm -rf ~/.local/share/gnome-shell/extensions/[email protected]
  3. Copy the built code to cp -r [email protected] ~/.local/share/gnome-shell/extensions/
  4. Logout and login Ubuntu. I have problem there is no file schemas/gschemas.compiled.
  5. I run make-zip.sh then the file schemas/gschemas.compiled is generated.
  6. I copy paste the gschemas.compiled file to ~/.local/share/gnome-shell/extensions/[email protected]/schemas
  7. Logout and login again Ubuntu. Then it worked.

Thanks for the great tool and the updates.

fakhrullah avatar Apr 27 '24 11:04 fakhrullah

I have tried this as well.

Unfortunately it doesn't work for me either.

I have installed it, logged out and logged in, disabled and enabled it, and after that it is visible on the top bar, but when I click on it, nothing happens; the icon doesn't change between the two states.

05storm26 avatar Apr 27 '24 11:04 05storm26

I built two new virtual machines fresh .. one with EndeavourOS and one with Fedora. On both platforms I am getting the same behavior 05storm26 noted above. I am not sure what is different for ajbucci and fakhrullah.

I can see some problems with the initialization code failing to connect InhibitorAdded and InhibitorRemoved events to the sessions manager. I am not sure why some of see this behavior and other don't.

coadmunkee avatar Apr 27 '24 20:04 coadmunkee

I'll build a fresh VM and try debugging later this week

ajbucci avatar Apr 28 '24 21:04 ajbucci

I still don't know why it was working for me on my Arch install... but I spun up a Fedora VM to debug and my latest commit should allow the code to run everywhere.

I can see some problems with the initialization code failing to connect InhibitorAdded and InhibitorRemoved events to the sessions manager. I am not sure why some of see this behavior and other don't.

This is actually OK as-is, there were some other errors that were halting execution inside _inhibitorAdded() and _sendNotification(). These should be fixed in my latest commit.

The reason we see the failure in the initialization for the InhibitorAdded and InhibitorRemoved signals is because they are expected to use connectSignal() instead of connect(). There is a try catch inside _connect() that handles this already. I would probably be more explicit and not use _connect() for InhibitorAdded and InhibitorRemoved, but I prefer to keep my changes to a minimum when I'm working in unfamiliar codebases to prevent unintended side-effects.

ajbucci avatar Apr 30 '24 16:04 ajbucci

I made a little time do some testing on my daily driver and on a couple of other distros on VMs. Everything seems to be working well. Thank you @ajbucci for some great work! I'll merge the pull request and submit an updated package to extensions.gnome.org this weekend.

coadmunkee avatar May 01 '24 12:05 coadmunkee

Hi @coadmunkee have you had time to submit the version for gnome 46 on the gnome extensions store?

jee-r avatar May 12 '24 08:05 jee-r

@jee-r - I just submitted version 10 to extensions.gnome.org (12 May 2024) ... it might be a day or so until peer review and approval are obtained for the release to be available on the site.

coadmunkee avatar May 12 '24 15:05 coadmunkee