From 1e4ba286bfeb79719d0542e177cbd41f3af1ca36 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 13 May 2020 19:18:01 +0100 Subject: [PATCH 1/5] Make it work with gnome-shell 3.36 Fixing "TypeError: this.actor.reparent is not a function", with reference from https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/pull/564 "Make it work with gnome-shell 3.36" --- src/extension.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/extension.js b/src/extension.js index 76195b1f..a50027b5 100644 --- a/src/extension.js +++ b/src/extension.js @@ -68,6 +68,22 @@ const WEATHER_SHOW_COMMENT_IN_PANEL_KEY = 'show-comment-in-panel'; // Weather ex const WEATHER_WIND_DIRECTION_KEY = 'wind-direction'; // Weather extension setting const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension setting +Clutter.Actor.prototype.raise_top = function raise_top() { + const parent = this.get_parent(); + if (!parent) { + return; + } + parent.set_child_above_sibling(this, null); +} + +Clutter.Actor.prototype.reparent = function reparent(newParent) { + const parent = this.get_parent(); + if (parent) { + parent.remove_child(this); + } + newParent.add_child(this); +} + // Init Weather class // const Weather = new Lang.Class( { From 04cc2081e659cf030ba252c43be2a9ec4c9355fb Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 13 May 2020 19:21:14 +0100 Subject: [PATCH 2/5] Bump supported versions up to 3.36 This seems to have no effect on Fedora 32; but should not hurt. --- data/metadata.json.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/metadata.json.in b/data/metadata.json.in index 806e563e..0990a1f6 100644 --- a/data/metadata.json.in +++ b/data/metadata.json.in @@ -2,7 +2,7 @@ "uuid": "@uuid@", "name": "Weather", "description": "A simple extension for displaying weather information from several cities in GNOME Shell", -"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20" ], +"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.32", "3.34", "3.36" ], "localedir": "@LOCALEDIR@", "url": "@url@" } From db939a1579050249d63b2ab42d0772ad2c71a41b Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Thu, 6 May 2021 00:11:27 +0100 Subject: [PATCH 3/5] Gnome-Shell 40 starts to check for shell-version again; need to explicitly mention "40" --- data/metadata.json.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/metadata.json.in b/data/metadata.json.in index 0990a1f6..e5fc4a8f 100644 --- a/data/metadata.json.in +++ b/data/metadata.json.in @@ -2,7 +2,7 @@ "uuid": "@uuid@", "name": "Weather", "description": "A simple extension for displaying weather information from several cities in GNOME Shell", -"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.32", "3.34", "3.36" ], +"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.32", "3.34", "3.36", "40" ], "localedir": "@LOCALEDIR@", "url": "@url@" } From 15f5052caa3137bf2923f242c58ffb9baf091c40 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Wed, 5 May 2021 23:13:26 +0100 Subject: [PATCH 4/5] Adjust to libgweather changes Application id and contact info are now required in order to use any online providers. The order of argument is important! enabled_providers must be after application_id/contact_info . See https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3577 https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1565 and https://gitlab.gnome.org/GNOME/libgweather/-/issues/75 https://gitlab.gnome.org/GNOME/libgweather/-/merge_requests/92 --- src/extension.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/extension.js b/src/extension.js index a50027b5..41a6fcbe 100644 --- a/src/extension.js +++ b/src/extension.js @@ -175,11 +175,15 @@ Clutter.Actor.prototype.reparent = function reparent(newParent) { this.location = this.city; if(this.city_name) { this.status("Location ("+this.city_name+") loaded"); - this.info = new GWeather.Info({location: this.location}); this.status("Information loaded"); - + this.info = new GWeather.Info({ + application_id: 'org.gnome.Shell', + contact_info: 'https://gitlab.gnome.org/GNOME/gnome-shell/-/raw/master/gnome-shell.doap', + location: this.location, + }); + this.status("Information loaded"); this.info.set_enabled_providers(GWeather.Provider.METAR | - GWeather.Provider.OWM | - GWeather.Provider.YR_NO); + GWeather.Provider.MET_NO | + GWeather.Provider.OWM); this.infoC = this.info.connect("updated",function(){that.refresh();that.status(0);}); this.status("Information connection started"); } From f471c4573873c218bf3fc8f41eeeb36495f3cfed Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Sun, 14 Nov 2021 17:40:52 +0000 Subject: [PATCH 5/5] Gnome 41 support --- data/metadata.json.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/metadata.json.in b/data/metadata.json.in index e5fc4a8f..5ab4711b 100644 --- a/data/metadata.json.in +++ b/data/metadata.json.in @@ -2,7 +2,7 @@ "uuid": "@uuid@", "name": "Weather", "description": "A simple extension for displaying weather information from several cities in GNOME Shell", -"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.32", "3.34", "3.36", "40" ], +"shell-version": [ "3.8", "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.32", "3.34", "3.36", "40", "41" ], "localedir": "@LOCALEDIR@", "url": "@url@" }