ethanwharris / gnome-nvidia-extension

A Gnome extension to show NVIDIA GPU information
46 stars 7 forks source link

Fix preferences crashing (GTK4) #182

Closed kenohassler closed 3 years ago

kenohassler commented 3 years ago

When using Gnome 40, the preferences window crashes instantly. nvidia-crash

Cause Gtk4 removed a few functions related to Gtk.Box: https://docs.gtk.org/gtk4/migrating-3to4.html#stop-using-gtkbox-padding-fill-and-expand-child-properties

Patch Replace box.pack_start() and box.add() by box.append(). Set the halign, hexpand and margin-* properties accordingly.

Issues Closes #181

kenohassler commented 3 years ago

Sorry for the force-pushing mess, I noticed I didn't sign the commits and wanted to amend them :smile: Also, an important caveat is these changes break backwards compatibility (tested in Ubuntu Focal).

derenv commented 3 years ago

Hi @kenohassler , I've marked this for review and will take a look at it soon!

derenv commented 3 years ago

Sorry for the force-pushing mess, I noticed I didn't sign the commits and wanted to amend them smile

That's fine, signed is better!

Also, an important caveat is these changes break backwards compatibility (tested in Ubuntu Focal).

This was kind of expected, it is a gnome extension and gtk4 is quite the update. Was this focal testing in gnome 40 or 3.38?

kenohassler commented 3 years ago

Was this focal testing in gnome 40 or 3.38?

I think Focal still uses 3.36... Anyway, I've re-tested in an up-to-date VM with Hirsute (gnome-shell 3.38), where it doesn't work: TypeError: box.append is not a function After upgrading the VM to the development version of 21.10, gnome complained that the extension is not compatible -- it worked on my bare-metal Manjaro installation :thinking: Modifying the shell-version property in metadata.json did the trick. Should I add a commit?

kenohassler commented 3 years ago

Hi @kenohassler , yeah this looks good! add the metadata.json update as a commit and i'll merge the request!

Alright, thanks for looking into it. I just added the metadata.json commit :+1: