Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sushi for openSUSE:Factory checked in at 2023-09-20 13:23:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sushi (Old) and /work/SRC/openSUSE:Factory/.sushi.new.16627 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sushi" Wed Sep 20 13:23:24 2023 rev:57 rq:1112198 version:45.0 Changes: -------- --- /work/SRC/openSUSE:Factory/sushi/sushi.changes 2023-06-08 21:42:16.149887444 +0200 +++ /work/SRC/openSUSE:Factory/.sushi.new.16627/sushi.changes 2023-09-20 13:24:51.253326358 +0200 @@ -1,0 +2,22 @@ +Mon Sep 18 19:43:41 UTC 2023 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 45.0: + + Updated translations. + +------------------------------------------------------------------- +Fri Jul 7 19:19:28 UTC 2023 - Bjørn Lie <bjorn....@gmail.com> + +- Update to version 45.alpha.2: + + Fix build. +- Changes from version 45.alpha.1: + + Fix translatable filename. +- Changes from version 45.alpha: + + Fix window size with custom scale factor in x11. + + Don't show window before renderer is ready. + + Allow keyboard copy shortcuts for evince and text viewers. + + Fix crash when switching between audio files. + + Fix coverart download. + + Add ParentHandle dbus property. + + Add development profile. + +------------------------------------------------------------------- Old: ---- sushi-44.2.tar.xz New: ---- sushi-45.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sushi.spec ++++++ --- /var/tmp/diff_new_pack.kGN1uF/_old 2023-09-20 13:24:52.713378665 +0200 +++ /var/tmp/diff_new_pack.kGN1uF/_new 2023-09-20 13:24:52.717378808 +0200 @@ -19,13 +19,13 @@ %global __requires_exclude typelib\\(LOKDocView\\) Name: sushi -Version: 44.2 +Version: 45.0 Release: 0 Summary: Quick Previewer for Nautilus License: SUSE-GPL-2.0-with-plugin-exception Group: Productivity/File utilities URL: https://www.gnome.org -Source0: https://download.gnome.org/sources/sushi/44/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/sushi/45/%{name}-%{version}.tar.xz Source99: sushi-rpmlintrc BuildRequires: meson @@ -74,7 +74,7 @@ %files %license COPYING -%doc AUTHORS NEWS README +%doc AUTHORS NEWS README.md %{_bindir}/%{name} %{_datadir}/dbus-1/services/org.gnome.NautilusPreviewer.service %{_datadir}/metainfo/org.gnome.NautilusPreviewer.appdata.xml ++++++ sushi-44.2.tar.xz -> sushi-45.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/.gitlab-ci.yml new/sushi-45.0/.gitlab-ci.yml --- old/sushi-44.2/.gitlab-ci.yml 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/.gitlab-ci.yml 2023-09-18 20:33:37.000000000 +0200 @@ -4,7 +4,7 @@ variables: MANIFEST_PATH: "flatpak/org.gnome.NautilusPreviewer.json" FLATPAK_MODULE: "sushi" - APP_ID: "org.gnome.NautilusPreviewer" + APP_ID: "org.gnome.NautilusPreviewerDevel" RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo" BUNDLE: "sushi-dev.flatpak" @@ -17,3 +17,11 @@ extends: - ".flatpak@aarch64" - ".flatpak-vars" + +nightly@x86_64: + extends: ".publish_nightly" + needs: ["flatpak@x86_64"] + +nightly@aarch64: + extends: ".publish_nightly" + needs: ["flatpak@aarch64"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/NEWS new/sushi-45.0/NEWS --- old/sushi-44.2/NEWS 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/NEWS 2023-09-18 20:33:37.000000000 +0200 @@ -1,3 +1,28 @@ +45.0 +==== + +- Translation updates + +45.alpha.2 + +- Fix build (Corey Berla) + +45.alpha.1 +==== + +- Fix translatable filename (Piotr DrÄ g) + +45.alpha +==== + +- Fix window size with custom scale factor in x11 (Nelson Ben) +- Don't show window before renderer is ready (Nelson Ben) +- Allow keyboard copy shortcuts for evince and text viewers (Corey Berla) +- Fix crash when switching between audio files (Corey Berla) +- Fix coverart download (Corey Berla) +- Add ParentHandle dbus property (Corey Berla) +- Add development profile (Corey Berla) + 44.2 ==== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/README new/sushi-45.0/README --- old/sushi-44.2/README 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -This is Sushi, a quick previewer for Nautilus, the GNOME desktop file manager. ------------------------------------------------------------------------------- - -Sushi is a DBus-activated service. For Sushi to popup, applications will have -to call the ShowFile method on the org.gnome.NautilusPreviewer interface. -If you want to or debug Sushi without a calling application, you can use -gdbus(1) to call the ShowFile method manually on the bus. - -======= -Methods -======= - -ShowFile(s: FileUri, i: ParentXid, b: CloseIfShown) - -Activates Sushi previewing the file at the provided URI. -If a XID is specified, the Sushi window is made transient to that window. -If the CloseIfShown parameter is TRUE, Sushi will close if it's already -running. - -Close() - -Explicitly closes Sushi. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/README.md new/sushi-45.0/README.md --- old/sushi-44.2/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/sushi-45.0/README.md 2023-09-18 20:33:37.000000000 +0200 @@ -0,0 +1,22 @@ +# Sushi + +This is Sushi, a quick previewer for Files (nautilus), the GNOME desktop file manager. + +## Using Sushi + +Sushi is a DBus-activated service. For Sushi to popup, applications will have to call the `ShowFile` method on the `org.gnome.NautilusPreviewer2` interface. + +If you want to debug Sushi without a calling application, you can use the `sushi <filename>` command. + +## Reporting issues + +Before filing an issue here, confirm that it has not been fixed on the latest nightly build. The easiest way to do this is by installing the nightly flatpak. + +``` +flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo +flatpak install gnome-nightly org.gnome.NautilusPreviewerDevel +``` + +After installing the nightly flatpak, you can launch Sushi via the below command, or by initiating a preview from the NautilusDevel nightly flatpak. + +`flatpak run org.gnome.NautilusPreviewerDevel <filename>` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/data/meson.build new/sushi-45.0/data/meson.build --- old/sushi-44.2/data/meson.build 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/data/meson.build 2023-09-18 20:33:37.000000000 +0200 @@ -1,17 +1,22 @@ -dbus_conf = configuration_data() +conf = configuration_data() -dbus_conf.set('libexecdir', libexecdir) +conf.set('libexecdir', libexecdir) +conf.set('app_id', app_id) configure_file( input: 'org.gnome.NautilusPreviewer.service.in', - output: 'org.gnome.NautilusPreviewer.service', - configuration: dbus_conf, + output: '@0@.service'.format(app_id), + configuration: conf, install_dir: join_paths(datadir, 'dbus-1', 'services'), ) i18n.merge_file( - input: 'org.gnome.NautilusPreviewer.appdata.xml.in', - output: 'org.gnome.NautilusPreviewer.appdata.xml', + input: configure_file( + input: 'org.gnome.NautilusPreviewer.appdata.xml.in.in', + output: '@BASENAME@', + configuration: conf + ), + output: '@0...@.appdata.xml'.format(app_id), po_dir: '../po', install: true, install_dir: join_paths(datadir, 'metainfo') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/data/org.gnome.NautilusPreviewer.appdata.xml.in new/sushi-45.0/data/org.gnome.NautilusPreviewer.appdata.xml.in --- old/sushi-44.2/data/org.gnome.NautilusPreviewer.appdata.xml.in 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/data/org.gnome.NautilusPreviewer.appdata.xml.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright 2015 Jiri Eischmann <eischm...@redhat.com> ---> -<component type="addon"> - <id>org.gnome.NautilusPreviewer</id> - <extends>org.gnome.Nautilus.desktop</extends> - <metadata_license>CC0-1.0</metadata_license> - <project_license>GPL-2.0+</project_license> - <name>Sushi</name> - <summary>Provide a facility for quickly viewing different kinds of files</summary> - <description> - <p> - Sushi is a file previewer for the GNOME desktop environment. It is an independent component that - integrates with GNOME Files (Nautilus). - </p> - </description> - <keywords> - <keyword>nautilus</keyword> - <keyword>sushi</keyword> - <keyword>view</keyword> - <keyword>previewer</keyword> - <keyword>preview</keyword> - </keywords> - <releases> - <release version="44.2" date="2023-05-28"/> - </releases> - <translation type="gettext">sushi</translation> - <url type="translate">https://wiki.gnome.org/TranslationProject</url> - <url type="homepage">https://gitlab.gnome.org/GNOME/sushi</url> - <url type="bugtracker">https://gitlab.gnome.org/GNOME/sushi/issues</url> - <update_contact>eischmann_at_redhat.com</update_contact> -</component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/data/org.gnome.NautilusPreviewer.appdata.xml.in.in new/sushi-45.0/data/org.gnome.NautilusPreviewer.appdata.xml.in.in --- old/sushi-44.2/data/org.gnome.NautilusPreviewer.appdata.xml.in.in 1970-01-01 01:00:00.000000000 +0100 +++ new/sushi-45.0/data/org.gnome.NautilusPreviewer.appdata.xml.in.in 2023-09-18 20:33:37.000000000 +0200 @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2015 Jiri Eischmann <eischm...@redhat.com> +--> +<component type="addon"> + <id>@app_id@</id> + <extends>org.gnome.Nautilus.desktop</extends> + <metadata_license>CC0-1.0</metadata_license> + <project_license>GPL-2.0+</project_license> + <name>Sushi</name> + <summary>Provide a facility for quickly viewing different kinds of files</summary> + <description> + <p> + Sushi is a file previewer for the GNOME desktop environment. It is an independent component that + integrates with GNOME Files (Nautilus). + </p> + </description> + <keywords> + <keyword>nautilus</keyword> + <keyword>sushi</keyword> + <keyword>view</keyword> + <keyword>previewer</keyword> + <keyword>preview</keyword> + </keywords> + <releases> + <release version="45.0" date="2023-09-18"/> + </releases> + <translation type="gettext">sushi</translation> + <url type="translate">https://wiki.gnome.org/TranslationProject</url> + <url type="homepage">https://gitlab.gnome.org/GNOME/sushi</url> + <url type="bugtracker">https://gitlab.gnome.org/GNOME/sushi/issues</url> + <update_contact>eischmann_at_redhat.com</update_contact> +</component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/data/org.gnome.NautilusPreviewer.service.in new/sushi-45.0/data/org.gnome.NautilusPreviewer.service.in --- old/sushi-44.2/data/org.gnome.NautilusPreviewer.service.in 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/data/org.gnome.NautilusPreviewer.service.in 2023-09-18 20:33:37.000000000 +0200 @@ -1,3 +1,3 @@ [D-BUS Service] -Name=org.gnome.NautilusPreviewer -Exec=@libexecdir@/org.gnome.NautilusPreviewer +Name=@app_id@ +Exec=@libexecdir@/@app_id@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/flatpak/org.gnome.NautilusPreviewer.json new/sushi-45.0/flatpak/org.gnome.NautilusPreviewer.json --- old/sushi-44.2/flatpak/org.gnome.NautilusPreviewer.json 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/flatpak/org.gnome.NautilusPreviewer.json 2023-09-18 20:33:37.000000000 +0200 @@ -1,5 +1,5 @@ { - "app-id": "org.gnome.NautilusPreviewer", + "app-id": "org.gnome.NautilusPreviewerDevel", "runtime": "org.gnome.Platform", "runtime-version": "master", "sdk": "org.gnome.Sdk", @@ -87,7 +87,8 @@ "buildsystem": "meson", "config-opts": [ "-Dinstall_tests=false", - "-Dgtk_doc=false" + "-Dgtk_doc=false", + "-Dvapi=false" ], "sources": [ { @@ -100,6 +101,9 @@ { "name": "sushi", "buildsystem": "meson", + "config-opts": [ + "-Dprofile=development" + ], "sources": [ { "type": "dir", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/meson.build new/sushi-45.0/meson.build --- old/sushi-44.2/meson.build 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/meson.build 2023-09-18 20:33:37.000000000 +0200 @@ -1,7 +1,7 @@ project( 'sushi', 'c', - version: '44.2', + version: '45.0', meson_version: '>=0.47.0' ) @@ -36,6 +36,14 @@ language: 'c', ) +if get_option('profile') == 'default' + app_id = 'org.gnome.NautilusPreviewer' +else + app_id = 'org.gnome.NautilusPreviewerDevel' +endif + +object_path = '/@0@'.format(app_id.replace('.', '/')) + i18n = import('i18n') subdir('data') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/meson_options.txt new/sushi-45.0/meson_options.txt --- old/sushi-44.2/meson_options.txt 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/meson_options.txt 2023-09-18 20:33:37.000000000 +0200 @@ -6,3 +6,8 @@ type: 'feature', value: 'auto', description: 'Build with legacy X11 support.') +option('profile', + type: 'combo', + choices: ['default', 'development'], + value: 'default', + description: 'Build with default or development App Id.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/po/POTFILES.in new/sushi-45.0/po/POTFILES.in --- old/sushi-44.2/po/POTFILES.in 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/po/POTFILES.in 2023-09-18 20:33:37.000000000 +0200 @@ -1,4 +1,6 @@ -data/org.gnome.NautilusPreviewer.appdata.xml.in +# List of source files containing translatable strings. +# Please keep this file sorted alphabetically. +data/org.gnome.NautilusPreviewer.appdata.xml.in.in src/ui/fallbackRenderer.js src/ui/mainWindow.js src/viewers/audio.js diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/po/tr.po new/sushi-45.0/po/tr.po --- old/sushi-44.2/po/tr.po 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/po/tr.po 2023-09-18 20:33:37.000000000 +0200 @@ -1,5 +1,5 @@ # Turkish translation for sushi. -# Copyright (C) 2011-2022 sushi's COPYRIGHT HOLDER +# Copyright (C) 2011-2023 sushi's COPYRIGHT HOLDER # This file is distributed under the same license as the sushi package. # # Muhammet Kara <muhamme...@gmail.com>, 2011. @@ -11,10 +11,10 @@ msgstr "" "Project-Id-Version: sushi master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/sushi/issues\n" -"POT-Creation-Date: 2022-07-24 06:37+0000\n" +"POT-Creation-Date: 2023-07-02 13:36+0000\n" "PO-Revision-Date: 2021-02-22 10:56+0300\n" "Last-Translator: Emin Tufan Ãetin <etce...@gmail.com>\n" -"Language-Team: Turkish <gnome-t...@gnome.org>\n" +"Language-Team: Turkish <ta...@gnome.org.tr>\n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,15 +23,15 @@ "X-Generator: Poedit 2.4.2\n" "X-POOTLE-MTIME: 1415555003.000000\n" -#: data/org.gnome.NautilusPreviewer.appdata.xml.in:9 +#: data/org.gnome.NautilusPreviewer.appdata.xml.in.in:9 msgid "Sushi" msgstr "Sushi" -#: data/org.gnome.NautilusPreviewer.appdata.xml.in:10 +#: data/org.gnome.NautilusPreviewer.appdata.xml.in.in:10 msgid "Provide a facility for quickly viewing different kinds of files" msgstr "DeÄiÅik türdeki dosyaları hızlıca görüntülemeyi saÄlar" -#: data/org.gnome.NautilusPreviewer.appdata.xml.in:12 +#: data/org.gnome.NautilusPreviewer.appdata.xml.in.in:12 msgid "" "Sushi is a file previewer for the GNOME desktop environment. It is an " "independent component that integrates with GNOME Files (Nautilus)." @@ -68,24 +68,24 @@ msgstr "%s gösterilemiyor" #. TRANSLATORS: This is the display name of an application, e.g. "Open With Image Viewer" -#: src/ui/mainWindow.js:342 +#: src/ui/mainWindow.js:358 #, javascript-format msgid "Open With %s" msgstr "%s İle Aç" -#: src/ui/mainWindow.js:348 +#: src/ui/mainWindow.js:364 msgid "Open" msgstr "Aç" -#: src/viewers/audio.js:375 +#: src/viewers/audio.js:401 msgid "from" msgstr "Albüm:" -#: src/viewers/audio.js:380 +#: src/viewers/audio.js:406 msgid "by" msgstr "Sanatçı:" -#: src/viewers/evince.js:94 +#: src/viewers/evince.js:103 #, javascript-format msgid "%d of %d" msgstr "%d / %d" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/libsushi/sushi-media-bin.c new/sushi-45.0/src/libsushi/sushi-media-bin.c --- old/sushi-44.2/src/libsushi/sushi-media-bin.c 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/libsushi/sushi-media-bin.c 2023-09-18 20:33:37.000000000 +0200 @@ -2134,7 +2134,7 @@ * Returns a #GstTagList with the audio tags for the played media */ SMB_DEFINE_GETTER_FULL (GstTagList *, audio_tags, NULL, - return (SMB_PRIVATE (self)->audio_tags); + return (gst_tag_list_ref (SMB_PRIVATE (self)->audio_tags)); ) /** @@ -2144,7 +2144,7 @@ * Returns a #GstTagList with the video tags for the played media */ SMB_DEFINE_GETTER_FULL (GstTagList *, video_tags, NULL, - return (SMB_PRIVATE (self)->video_tags); + return (gst_tag_list_ref (SMB_PRIVATE (self)->video_tags)); ) /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/libsushi/sushi-utils.c new/sushi-45.0/src/libsushi/sushi-utils.c --- old/sushi-44.2/src/libsushi/sushi-utils.c 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/libsushi/sushi-utils.c 2023-09-18 20:33:37.000000000 +0200 @@ -31,6 +31,9 @@ #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> #endif +#ifdef GDK_WINDOWING_WAYLAND +#include <gdk/gdkwayland.h> +#endif #include "externalwindow.h" @@ -399,3 +402,18 @@ return pixbuf; } + +/** + * sushi_running_under_wayland: + * + * Returns: Whether we are running under Wayland backend. + */ +gboolean +sushi_running_under_wayland (GdkDisplay *display) +{ +#ifdef GDK_WINDOWING_WAYLAND + return GDK_IS_WAYLAND_DISPLAY (display); +#endif + + return FALSE; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/libsushi/sushi-utils.h new/sushi-45.0/src/libsushi/sushi-utils.h --- old/sushi-44.2/src/libsushi/sushi-utils.h 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/libsushi/sushi-utils.h 2023-09-18 20:33:37.000000000 +0200 @@ -57,6 +57,7 @@ void sushi_window_set_child_of_external (GtkWindow *window, const char *handle); +gboolean sushi_running_under_wayland (GdkDisplay *display); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/meson.build new/sushi-45.0/src/meson.build --- old/sushi-44.2/src/meson.build 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/meson.build 2023-09-18 20:33:37.000000000 +0200 @@ -3,16 +3,23 @@ # Compile libsushi and its introspection data subdir('libsushi') +conf_src = configuration_data() +conf_src.set('object_path', object_path) + sushi_src_resources = gnome.compile_resources( - 'org.gnome.NautilusPreviewer.src', - 'org.gnome.NautilusPreviewer.src.gresource.xml', + '@0@.src'.format(app_id), + configure_file( + input: 'org.gnome.NautilusPreviewer.src.gresource.xml.in', + output: '@BASENAME@', + configuration: conf_src + ), gresource_bundle: true, install: true, install_dir: pkgdatadir, ) sushi_data_resources = gnome.compile_resources( - 'org.gnome.NautilusPreviewer.data', + '@0@.data'.format(app_id), 'org.gnome.NautilusPreviewer.data.gresource.xml', gresource_bundle: true, install: true, @@ -26,10 +33,12 @@ conf.set('prefix', get_option('prefix')) conf.set('libdir', libdir) conf.set('pkgdatadir', pkgdatadir) +conf.set('app_id', app_id) +conf.set('object_path', object_path) nautilus_previewer_bin = configure_file( input: 'org.gnome.NautilusPreviewer.in', - output: 'org.gnome.NautilusPreviewer', + output: app_id, configuration: conf, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/org.gnome.NautilusPreviewer.src.gresource.xml new/sushi-45.0/src/org.gnome.NautilusPreviewer.src.gresource.xml --- old/sushi-44.2/src/org.gnome.NautilusPreviewer.src.gresource.xml 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/org.gnome.NautilusPreviewer.src.gresource.xml 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gresources> - <gresource prefix="/org/gnome/NautilusPreviewer/js"> - <file>ui/application.js</file> - <file>ui/fallbackRenderer.js</file> - <file>ui/main.js</file> - <file>ui/mainWindow.js</file> - <file>ui/mimeHandler.js</file> - <file>ui/renderer.js</file> - <file>ui/utils.js</file> - <file>util/constants.js</file> - <file>util/totemMimeTypes.js</file> - <file>viewers/audio.js</file> - <file>viewers/evince.js</file> - <file>viewers/font.js</file> - <file>viewers/gst.js</file> - <file>viewers/html.js</file> - <file>viewers/image.js</file> - <file>viewers/libreoffice.js</file> - <file>viewers/text.js</file> - </gresource> -</gresources> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/org.gnome.NautilusPreviewer.src.gresource.xml.in new/sushi-45.0/src/org.gnome.NautilusPreviewer.src.gresource.xml.in --- old/sushi-44.2/src/org.gnome.NautilusPreviewer.src.gresource.xml.in 1970-01-01 01:00:00.000000000 +0100 +++ new/sushi-45.0/src/org.gnome.NautilusPreviewer.src.gresource.xml.in 2023-09-18 20:33:37.000000000 +0200 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="@object_path@/js"> + <file>ui/application.js</file> + <file>ui/fallbackRenderer.js</file> + <file>ui/main.js</file> + <file>ui/mainWindow.js</file> + <file>ui/mimeHandler.js</file> + <file>ui/renderer.js</file> + <file>ui/utils.js</file> + <file>util/constants.js</file> + <file>util/totemMimeTypes.js</file> + <file>viewers/audio.js</file> + <file>viewers/evince.js</file> + <file>viewers/font.js</file> + <file>viewers/gst.js</file> + <file>viewers/html.js</file> + <file>viewers/image.js</file> + <file>viewers/libreoffice.js</file> + <file>viewers/text.js</file> + </gresource> +</gresources> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/org.gnome.NautilusPreviewer2.xml new/sushi-45.0/src/org.gnome.NautilusPreviewer2.xml --- old/sushi-44.2/src/org.gnome.NautilusPreviewer2.xml 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/org.gnome.NautilusPreviewer2.xml 2023-09-18 20:33:37.000000000 +0200 @@ -7,6 +7,8 @@ </method> <method name="Close"> </method> + <!-- Since version 45 --> + <property name="ParentHandle" type="s" access="read" /> <property name="Visible" type="b" access="read" /> <signal name="SelectionEvent"> <arg type="q" name="direction" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/sushi.in new/sushi-45.0/src/sushi.in --- old/sushi-44.2/src/sushi.in 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/sushi.in 2023-09-18 20:33:37.000000000 +0200 @@ -31,7 +31,7 @@ } try { - let dataResource = Gio.Resource.load('@pkgdatadir@/org.gnome.NautilusPreviewer.data.gresource'); + let dataResource = Gio.Resource.load('@pkgdatadir@/@app_id@.data.gresource'); dataResource._register(); } catch(e) { logError(e, 'Unable to load data resource'); @@ -45,7 +45,7 @@ let proxy; try { proxy = new wrapper( - Gio.DBus.session, 'org.gnome.NautilusPreviewer', '/org/gnome/NautilusPreviewer'); + Gio.DBus.session, '@app_id@', '@object_path@'); } catch(e) { logError(e, 'Unable to create DBus proxy for NautilusPreviewer'); System.exit(1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/ui/application.js new/sushi-45.0/src/ui/application.js --- old/sushi-44.2/src/ui/application.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/ui/application.js 2023-09-18 20:33:37.000000000 +0200 @@ -89,11 +89,13 @@ } vfunc_dbus_register(connection, path) { + let actualPath = `/org/gnome/${pkg.name.split('.').at(-1)}`; + this._skeleton = new NautilusPreviewer1Skeleton(this); this._skeleton2 = new NautilusPreviewer2Skeleton(this); - this._skeleton.export(connection, path); - this._skeleton2.export(connection, path); + this._skeleton.export(connection, actualPath); + this._skeleton2.export(connection, actualPath); return super.vfunc_dbus_register(connection, path); } @@ -113,6 +115,9 @@ return; this._mainWindow = new MainWindow.MainWindow(this); + if (pkg.name.endsWith('Devel')) + this._mainWindow.get_style_context().add_class('devel'); + this._skeleton2.impl.emit_property_changed( 'Visible', new GLib.Variant('b', true)); @@ -138,6 +143,11 @@ 'SelectionEvent', new GLib.Variant('(u)', [direction])); } + updateParentHandle(handle) { + this._skeleton2.impl.emit_property_changed( + 'ParentHandle', new GLib.Variant('s', handle)); + } + showFile(uri, windowHandle, closeIfAlreadyShown) { this._ensureMainWindow(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/ui/main.js new/sushi-45.0/src/ui/main.js --- old/sushi-44.2/src/ui/main.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/ui/main.js 2023-09-18 20:33:37.000000000 +0200 @@ -46,10 +46,8 @@ const Application = imports.ui.application; -const SUSHI_DBUS_NAME = 'org.gnome.NautilusPreviewer'; - function main(argv) { - let application = new Application.Application({ application_id: SUSHI_DBUS_NAME, + let application = new Application.Application({ application_id: pkg.name, flags: Gio.ApplicationFlags.IS_SERVICE, inactivity_timeout: 12000 }); if (GLib.getenv('SUSHI_PERSIST')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/ui/mainWindow.js new/sushi-45.0/src/ui/mainWindow.js --- old/sushi-44.2/src/ui/mainWindow.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/ui/mainWindow.js 2023-09-18 20:33:37.000000000 +0200 @@ -116,7 +116,7 @@ let [lhs, rhs] = decorationLayout.split(':'); let leftGroup = lhs.split(',').filter(_isSupported); - let rightGroup = rhs.split(',').filter(_isSupported); + let rightGroup = rhs ? rhs.split(',').filter(_isSupported) : []; return [leftGroup.join(','), rightGroup.join(',')].join(':'); }; @@ -152,6 +152,15 @@ this._embed = new Embed(); eventBox.add(this._embed); + // call show_all() early when there's still no child Renderer, because show_all() later + // when the Renderer is a child may have unexpected results, see comments in !49 + this.show_all(); + + // but leave MainWindow not visible, because we want it to be firstly shown/mapped + // when it has its final dimemnsions i.e. when the Renderer has emmitted the 'ready' + // signal, i.e. on the _onRendererReady() handler. + this.hide(); + this._defineActions(); } @@ -228,15 +237,15 @@ if (this._renderer.ready) { this._resizeWindow(); this.queue_resize(); + this.show(); } - if (!this.visible) - this.show_all(); } _getMaxSize() { let gdkWin = this.get_window(); let display = this.get_display(); + let underWayland = Sushi.running_under_wayland(display); let monitor = display.get_monitor_at_window(gdkWin); let geometry = monitor.get_geometry(); @@ -250,8 +259,15 @@ // See https://gitlab.gnome.org/GNOME/gtk/issues/1828 let versionCheck = Gtk.check_version(3, 24, 9); if (!versionCheck) { - scaleW = (geometry.width / WINDOW_MAX_W_BASE) / this.get_scale_factor (); - scaleH = (geometry.height / WINDOW_MAX_H_BASE) / this.get_scale_factor (); + scaleW = (geometry.width / WINDOW_MAX_W_BASE); + scaleH = (geometry.height / WINDOW_MAX_H_BASE); + } + + // reduce by scale factor only under Wayland, otherwise + // X11 HiDPI windows are shown too small -- Issue #91 + if (underWayland) { + scaleW = scaleW / this.get_scale_factor (); + scaleH = scaleH / this.get_scale_factor (); } return [Math.floor(scaleW * WINDOW_MAX_W), @@ -375,6 +391,7 @@ **************************************************************************/ setParent(handle) { Sushi.window_set_child_of_external(this, handle); + this.application.updateParentHandle(handle); } setFile(file) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/viewers/audio.js new/sushi-45.0/src/viewers/audio.js --- old/sushi-44.2/src/viewers/audio.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/viewers/audio.js 2023-09-18 20:33:37.000000000 +0200 @@ -46,9 +46,9 @@ return str; } -const AMAZON_IMAGE_FORMAT = "http://images.amazon.com/images/P/%s.01.LZZZZZZZ.jpg"; -const MUSIC_BRAINZ_ASIN_FORMAT = "https://musicbrainz.org/ws/2/release/?query=release:\"%s\"AND artist:\"%s\"&limit=1&fmt=json&inc=asin"; -const fetchCoverArt = function(_tagList, _callback) { +const COVER_ART_ARCHIVE_URL = "https://coverartarchive.org/release/%s"; +const MUSIC_BRAINZ_ASIN_FORMAT = "https://musicbrainz.org/ws/2/release/?query=release:\"%s\"AND artist:\"%s\"&limit=1&fmt=json"; +const fetchCoverArt = function(_tagList, _cancellable, _callback) { function _fetchFromTags() { let coverSample = null; let idx = 0; @@ -85,13 +85,13 @@ return null; } - function _getCacheFile(asin) { + function _getCacheFile(mbid) { let cachePath = GLib.build_filenamev([GLib.get_user_cache_dir(), 'sushi']); - return Gio.File.new_for_path(GLib.build_filenamev([cachePath, `${asin}.jpg`])); + return Gio.File.new_for_path(GLib.build_filenamev([cachePath, `${mbid}.jpg`])); } function _fetchFromStream(stream, done) { - GdkPixbuf.Pixbuf.new_from_stream_async(stream, null, (o, res) => { + GdkPixbuf.Pixbuf.new_from_stream_async(stream, _cancellable, (o, res) => { let cover; try { cover = GdkPixbuf.Pixbuf.new_from_stream_finish(res); @@ -104,9 +104,9 @@ }); } - function _fetchFromCache(asin, done) { - let file = _getCacheFile(asin); - file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_TYPE, 0, 0, null, (f, res) => { + function _fetchFromCache(mbid, done) { + let file = _getCacheFile(mbid); + file.query_info_async(Gio.FILE_ATTRIBUTE_STANDARD_TYPE, 0, 0, _cancellable, (f, res) => { try { file.query_info_finish(res); } catch (e) { @@ -114,7 +114,7 @@ return; } - file.read_async(0, null, (f, res) => { + file.read_async(0, _cancellable, (f, res) => { let stream; try { stream = file.read_finish(res); @@ -128,12 +128,12 @@ }); } - function _saveToCache(asin, stream, done) { - let cacheFile = _getCacheFile(asin); + function _saveToCache(mbid, stream, done) { + let cacheFile = _getCacheFile(mbid); let cachePath = cacheFile.get_parent().get_path(); GLib.mkdir_with_parents(cachePath, 448); - cacheFile.replace_async(null, false, Gio.FileCreateFlags.PRIVATE, 0, null, (f, res) => { + cacheFile.replace_async(null, false, Gio.FileCreateFlags.PRIVATE, 0, _cancellable, (f, res) => { let outStream; try { outStream = cacheFile.replace_finish(res); @@ -146,7 +146,7 @@ stream, Gio.OutputStreamSpliceFlags.CLOSE_SOURCE | Gio.OutputStreamSpliceFlags.CLOSE_TARGET, - 0, null, (s, res) => { + 0, _cancellable, (s, res) => { try { outStream.splice_finish(res); } catch (e) { @@ -159,68 +159,90 @@ }); } - function _fetchFromAmazon(asin, done) { - let uri = AMAZON_IMAGE_FORMAT.format(asin); + function decode(buffer) { + let decoder = new TextDecoder('utf8'); + return decoder.decode(buffer); + } + + function _fetchCoverArtArchiveImage(uri, mbid, done) { let session = new Soup.Session(); - let request; - try { - request = session.request(uri); - } catch (e) { - done(e, null); - return; - } + let message = Soup.Message.new('GET', uri); + message.request_headers.append('User-Agent', 'gnome-sushi'); - request.send_async(null, (r, res) => { + session.send_async(message, 0, _cancellable, (r, res) => { let stream; try { - stream = request.send_finish(res); + stream = session.send_finish(res); } catch (e) { done(e, null); return; } - _saveToCache(asin, stream, (err) => { + _saveToCache(mbid, stream, (err) => { if (err) logError(err, 'Unable to save cover to cache'); - _fetchFromCache(asin, done); + _fetchFromCache(mbid, done); }); }); } - function _fetchFromASIN(done) { + function _fetchCoverArtArchiveMetadata(mbid, done) { + let uri = COVER_ART_ARCHIVE_URL.format(mbid); + let session = new Soup.Session(); + + let message = Soup.Message.new('GET', uri); + message.request_headers.append('User-Agent', 'gnome-sushi'); + session.send_and_read_async(message, 0, _cancellable, (r, res) => { + try { + let data = decode(session.send_and_read_finish(res).get_data()); + if (message.get_status() !== Soup.Status.OK) + return; + + let json_data = JSON.parse (data); + + let uri = json_data['images'][0]['thumbnails']['small']; + _fetchCoverArtArchiveImage(uri, mbid, done); + return; + } catch (e) { + done(e, null); + } + }); + } + + function _fetchFromMusicBrainz(done) { let artist = _tagList.get_string('artist')[1]; let album = _tagList.get_string('album')[1]; let uri = MUSIC_BRAINZ_ASIN_FORMAT.format(album, artist); - let session = new Soup.SessionAsync(); + let session = new Soup.Session(); - let request; - try { - request = Soup.Message.new('GET', uri); - request.request_headers.append('User-Agent', 'gnome-sushi'); - } catch (e) { - done(e, null); - return; - } + let message = Soup.Message.new('GET', uri); + message.request_headers.append('User-Agent', 'gnome-sushi'); - session.queue_message(request, (r, res) => { - let asin = null; - if (request.status_code == Soup.Status.OK) { - try { - let json_response = JSON.parse(request.response_body.data); - asin = json_response['release'][0]['asin'].toString(); - } catch (e) { - done(e, null); + session.send_and_read_async(message, 0, _cancellable, (r, res) => { + let mbid = null; + try { + let data = decode(session.send_and_read_finish(res).get_data()); + if (message.get_status() !== Soup.Status.OK) return; - } + + let json_response = JSON.parse(data); + + if (!('releases' in json_response) || json_response['releases'].length === 0) + return; + + mbid = json_response['releases'][0]['id']; + } catch (e) { + done (e, null); + return; } - _fetchFromCache(asin, (err, cover) => { + _fetchFromCache(mbid, (err, cover) => { if (cover) done(null, cover); else - _fetchFromAmazon(asin, done); + _fetchCoverArtArchiveMetadata(mbid, done); }); }); } @@ -231,7 +253,7 @@ return; } - _fetchFromASIN(_callback); + _fetchFromMusicBrainz(_callback); } const AudioPlayer = GObject.registerClass({ @@ -321,6 +343,7 @@ vbox.pack_start(this._albumLabel, false, false, 0); this.connect('destroy', this._onDestroy.bind(this)); + this._cancellable = new Gio.Cancellable(); this.isReady(); } @@ -329,6 +352,8 @@ GLib.source_remove(this._autoplayId); this._autoplayId = 0; } + + this._cancellable.cancel(); } _setCover(cover) { @@ -352,7 +377,8 @@ _onCoverArtFetched(err, cover) { if (err) { - if (!err.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) + if (!err.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) && + !err.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) logError(err, 'Unable to fetch cover art'); return; } @@ -384,7 +410,7 @@ this._titleLabel.set_markup('<b>' + escaped + '</b>'); if (artistName && albumName && !this._coverFetched) { - fetchCoverArt(tags, this._onCoverArtFetched.bind(this)); + fetchCoverArt(tags, this._cancellable, this._onCoverArtFetched.bind(this)); this._coverFetched = true; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/viewers/evince.js new/sushi-45.0/src/viewers/evince.js --- old/sushi-44.2/src/viewers/evince.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/viewers/evince.js 2023-09-18 20:33:37.000000000 +0200 @@ -23,7 +23,7 @@ * */ -const {EvinceDocument, EvinceView, GObject, Gtk, Sushi} = imports.gi; +const {EvinceDocument, EvinceView, Gio, GObject, Gtk, Sushi} = imports.gi; const Constants = imports.util.constants; const Renderer = imports.ui.renderer; @@ -71,6 +71,8 @@ }); } + this._defineActions(); + this._view = EvinceView.View.new(); this._view.show(); this.add(this._view); @@ -120,6 +122,18 @@ this._view.set_model(this._model); } + _defineActions() { + let application = Gio.Application.get_default (); + let copyAction = new Gio.SimpleAction({ name: 'copy' }); + copyAction.connect ('activate', () => { + this._view.copy(); + }); + application.set_accels_for_action ('evince.copy', ['<control>c']); + let actionGroup = new Gio.SimpleActionGroup(); + actionGroup.add_action(copyAction); + this.insert_action_group ('evince', actionGroup); + } + get moveOnClick() { return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/src/viewers/text.js new/sushi-45.0/src/viewers/text.js --- old/sushi-44.2/src/viewers/text.js 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/src/viewers/text.js 2023-09-18 20:33:37.000000000 +0200 @@ -55,7 +55,7 @@ cursor_visible: false, monospace: true, show_line_numbers: !!buffer.language }); - this._view.set_can_focus(false); + this.add(this._view); this.isReady(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sushi-44.2/sushi.doap new/sushi-45.0/sushi.doap --- old/sushi-44.2/sushi.doap 2023-05-28 20:43:10.000000000 +0200 +++ new/sushi-45.0/sushi.doap 2023-09-18 20:33:37.000000000 +0200 @@ -15,13 +15,13 @@ <programming-language>JavaScript</programming-language> <programming-language>C</programming-language> - <maintainer> + <author> <foaf:Person> <foaf:name>Cosimo Cecchi</foaf:name> <foaf:mbox rdf:resource="mailto:cosi...@gnome.org" /> <gnome:userid>cosimoc</gnome:userid> </foaf:Person> - </maintainer> + </author> <maintainer> <foaf:Person> <foaf:name>Felipe Borges</foaf:name>