Bug#1143101: papers: Backport upstream GVFS Google Drive PDF fix to trixie

Eduardo Leggiero esleggiero at gmail.com
Thu Jul 30 13:02:04 BST 2026


Package: papers
Version: 48.3-1
Severity: important
Tags: patch
X-Debbugs-Cc: esleggiero at gmail.com

Dear Maintainer,

Opening PDF files located on GVFS mounts provided by GNOME Online Accounts (for
example, Google Drive) fails in Papers on Debian 13 (Trixie). The same files
can be opened successfully with Evince.

What led up to the situation?

I use GNOME Online Accounts to access files stored in Google Drive. PDF files
are exposed through GVFS and can be accessed from the GNOME file manager.

What exactly did you do?

I attempted to open a PDF stored in Google Drive using Papers.

I investigated the issue and found that it has already been fixed upstream by
commit:

https://gitlab.gnome.org/GNOME/Incubator/papers/-/commit/d1ea5f93b5465386d4bfb548f7fe6f1b8469cdfb

This fix is included in Papers 48.7 and later.

To verify that this is the correct fix, I backported the single upstream commit
to the Debian 13 package (48.3-1), rebuilt the package on Debian 13 using
sbuild, installed it, and tested it.

What was the outcome?

With the unmodified Debian package (48.3-1), Papers is unable to open PDFs from
GVFS-backed locations such as Google Drive.

After applying the upstream patch, Papers opens the same PDFs correctly.

What outcome did you expect instead?

I expected Papers to open PDFs from GVFS mounts in the same way as local files
and consistently with Evince.

The attached debdiff contains only the backport of the upstream fix and is
proposed as a candidate for inclusion in a future Debian 13 (Trixie) stable
update.

Thank you,

Eduardo Leggiero


-- System Information:
Debian Release: 13.6
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'stable-security'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 7.1.3+deb13-amd64 (SMP w/14 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages papers depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.40.0-5
ii  gsettings-desktop-schemas                    48.0-1
ii  libadwaita-1-0                               1.7.6-1~deb13u1
ii  libc6                                        2.41-12+deb13u3
ii  libgcc-s1                                    14.2.0-19
ii  libgdk-pixbuf-2.0-0                          2.42.12+dfsg-4+deb13u1
ii  libglib2.0-0t64                              2.84.4-3~deb13u3
ii  libgraphene-1.0-0                            1.10.8-5
ii  libgtk-4-1                                   4.18.6+ds-2
ii  libnautilus-extension4                       48.3-2
ii  libpango-1.0-0                               1.56.3-1
ii  libppsdocument-4.0-5                         48.3-1
ii  libppsview-4.0-4                             48.3-1
ii  papers-common                                48.3-1
ii  shared-mime-info                             2.4-5+b2

papers recommends no packages.

Versions of packages papers suggests:
ii  gvfs             1.57.2-2+deb13u1
pn  nautilus-sendto  <none>
ii  poppler-data     0.4.12-1
pn  unrar            <none>

-- no debconf information
-------------- next part --------------
diff -Nru papers-48.3/debian/changelog papers-48.3/debian/changelog
--- papers-48.3/debian/changelog	2025-06-06 19:54:42.000000000 +0100
+++ papers-48.3/debian/changelog	2026-07-30 09:44:31.000000000 +0100
@@ -1,3 +1,9 @@
+papers (48.3-1+gvfs1) trixie; urgency=medium
+
+  * Backport GVFS Google Drive fix.
+
+ -- Eduardo Leggiero <esleggiero at gmail.com>  Thu, 30 Jul 2026 09:44:31 +0100
+
 papers (48.3-1) unstable; urgency=medium
 
   * New upstream bugfix release
diff -Nru papers-48.3/debian/patches/fix-opening-pdfs-from-gvfs.patch papers-48.3/debian/patches/fix-opening-pdfs-from-gvfs.patch
--- papers-48.3/debian/patches/fix-opening-pdfs-from-gvfs.patch	1970-01-01 01:00:00.000000000 +0100
+++ papers-48.3/debian/patches/fix-opening-pdfs-from-gvfs.patch	2026-07-30 09:34:29.000000000 +0100
@@ -0,0 +1,84 @@
+diff --git a/shell/src/window.rs b/shell/src/window.rs
+index 46d7199..c8a2b7c 100644
+--- a/shell/src/window.rs
++++ b/shell/src/window.rs
+@@ -993,22 +993,69 @@ mod imp {
+                 #[weak(rename_to = obj)]
+                 self,
+                 async move {
+-                    if path.is_none() {
++                    // Check if the file comes from a remote GVFS backend (like Google Drive, SMB, SFTP, etc.)
++                    // These usually need to be copied locally to avoid access or seek issues.
++                    let is_gvfs = file
++                        .uri_scheme()
++                        .map(|scheme| {
++                            // List of GVFS backends that should be copied locally:
++                            // - Network: smb, ftp, sftp, dav/davs, nfs
++                            // - Cloud: google-drive, onedrive
++                            // - Mobile: afc (ios), mtp (android)
++                            // - Other: afp (Apple Filing Protocol)
++                            matches!(
++                                scheme.as_str(),
++                                "afc"
++                                    | "afp"
++                                    | "dav"
++                                    | "davs"
++                                    | "ftp"
++                                    | "google-drive"
++                                    | "mtp"
++                                    | "nfs"
++                                    | "onedrive"
++                                    | "sftp"
++                                    | "smb"
++                            )
++                        })
++                        .unwrap_or(false);
++
++                    // If the file doesn't have a normal local path or if it's remote file,
++                    // then copy it locally before opening to avoid permission or access problems.
++                    if path.is_none() || is_gvfs {
+                         obj.load_remote_file(file.as_ref()).await;
+                     } else {
+-                        // source_file is probably local, but make sure it's seekable
+-                        // before loading it directly.
++                        // File appears to be local, but verify it's actually seekable.
++                        // Some FUSE-backed GVFS filesystems may provide paths but still have seekability issues
+                         let result = file.read_future(glib::Priority::DEFAULT).await;
+ 
+-                        if let Ok(stream) = result {
+-                            if !stream.can_seek() {
+-                                return obj.load_remote_file(file.as_ref()).await;
++                        match result {
++                            Ok(stream) => {
++                                // Check If the stream doesn?t support seeking at all, then treat it as remote.
++                                if !stream.can_seek() {
++                                    return obj.load_remote_file(file.as_ref()).await;
++                                }
++
++                                // Verify that G_SEEK_END works because
++                                // some GVFS backends claim to support seeking, but fail when using G_SEEK_END.
++                                let seekable = stream.upcast_ref::<gio::Seekable>();
++                                if seekable
++                                    .seek(0, glib::SeekType::End, gio::Cancellable::NONE)
++                                    .is_err()
++                                {
++                                    return obj.load_remote_file(file.as_ref()).await;
++                                }
++
++                                // If stream is properly seekable, load directly
++                                obj.loader_view.set_fraction(-1_f64);
++                                obj.set_mode(WindowRunMode::LoaderView);
++                                load_job.scheduler_push_job(papers_view::JobPriority::PriorityNone);
++                            }
++                            Err(_) => {
++                                // If it failed to open stream, try copying to local
++                                obj.load_remote_file(file.as_ref()).await;
+                             }
+                         }
+-
+-                        obj.loader_view.set_fraction(-1_f64);
+-                        obj.set_mode(WindowRunMode::LoaderView);
+-                        load_job.scheduler_push_job(papers_view::JobPriority::PriorityNone);
+                     }
+                 }
+             ));
diff -Nru papers-48.3/debian/patches/series papers-48.3/debian/patches/series
--- papers-48.3/debian/patches/series	2025-06-06 19:54:42.000000000 +0100
+++ papers-48.3/debian/patches/series	2026-07-30 09:36:24.000000000 +0100
@@ -1,3 +1,4 @@
 meson.build-fix-build-for-Debian.patch
 shell-rs-build-re-generate-bindings-before-building-exe.patch
 relax-deps.patch
+fix-opening-pdfs-from-gvfs.patch


More information about the pkg-gnome-maintainers mailing list