arelange / gnome-shell-extension-hibernate-status

Gnome Shell extension that adds a hibernate/hybrid suspend button in Status menu.
GNU General Public License v2.0
151 stars 54 forks source link

Close dialog after connect to the closed signal #103

Closed leggiero closed 12 months ago

leggiero commented 12 months ago

The hibernate button is not working in Gnome 44 (tested on Fedora 38). Probably because something changed in the GTK 4.0.

Error message: (...) ConfirmDialog (...) has been already disposed - impossible to connect to any signal on it.

I fixed by closing the dialog only after connecting to the closed signal as the object property destroyOnClose is set to true.

Full error log:

Jun 07 21:11:49 [machine] gnome-shell[2274]: have hibernate true
Jun 07 21:11:56 [machine] gnome-shell[2274]: Object .Gjs_hibernate-status_dromi_confirmDialog_ConfirmDialog (0x55b50e3615e0), has been already disposed — impossible to connect to any signal on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
Jun 07 21:11:56 [machine] gnome-shell[2274]: == Stack trace for context 0x55b509284130 ==
Jun 07 21:11:56 [machine] gnome-shell[2274]: #0   55b50eab7ee8 i   /home/[username]/.local/share/gnome-shell/extensions/hibernate-status@dromi/confirmDialog.js:168 (38c894f6c240 @ 43)
Jun 07 21:11:56 [machine] gnome-shell[2274]: #1   55b50eab7e68 i   resource:///org/gnome/shell/ui/dialog.js:130 (9f0a32c5060 @ 11)
p91paul commented 12 months ago

Thanks!