1.78.2 regression - surface disposed with held references

Description:

"Instead of only releasing the native reference held by gjs, we now dispose the surface when the JS wrapper object is garbage collected, regardless of any references held elsewhere (namely the corresponding toplevel)."

Initially found in https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7325, where Gnome extension prefs window would disappear.

Additional info:

Steps to reproduce:

  1. Open the preferences of a Gnome Shell extension
  2. Watch that pref window disappear shortly thereafter

Please consider cherry-picking https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/909.

I built gjs 1.78.2+!909 cherry picked, packaged for Arch as gjs 2:1.78.2-2, and can verify the regression issue is resolved.

Edited by tekstryder