medenagan / window-corner-preview

GNOME Shell extension showing a video preview on the corner of the screen
https://extensions.gnome.org/extension/1227/window-corner-preview/
MIT License
135 stars 26 forks source link

Port to GNOME 3.34 #21

Open jtojnar opened 4 years ago

jtojnar commented 4 years ago

I can now use the extension successfully on GNOME 3.34. There are still some bugs to work out, though:

Does anyone have an idea how to solve these?

What has been done

I had to accomodate the following GNOME Shell changes:

Additionally:

jtojnar commented 4 years ago

Perhaps it would be a good idea to convert all the listeners and emits to GObject properties connected together with GBinding. Hopefully, GLib is smart enough to not cycle.

Unfortunately, the data flows throughout almost all the modules so we would need to duplicate the properties everywhere.

graph

I tried the following but apparently G_MINDOUBLE is not exposed to JavaScript.

var PopupSliderMenuItem = GObject.registerClass({
    Properties: {
        'value': GObject.ParamSpec.double(
            'value', 'value', 'value',
            GObject.ParamFlags.READWRITE,
            GLib.MINDOUBLE, GLib.MAXDOUBLE, 0,
    },
}, class PopupSliderMenuItem extends PopupMenu.PopupBaseMenuItem {
    …
        this.slider.bind_property_full(
            'value',
            this,
            'value',
            GObject.BindingFlags.BIDIRECTIONAL,
            (value) => deNormalizeRange(value, this.min, this.max, this.step),
            (value) => normalizeRange(value, this.min, this.max, this.step)
        );