Package: simple-scan
Version: 3.26.2-1
Severity: important
Tags: patch upstream

Dear Maintainer,

I'm just going to copy/paste Sebastiaan Lokhorst's upstream bug report:

«After updating to 3.26, no scanned images are shown, so I can't see what I've
just scanned. It just shows "Ready to Scan" after it's done with a scan.

However, I can still click the save button, and the images come out fine. I just
can't review them in simple-scan, which is very inconvenient.

Tested with 3.26.1 and 3.26.2 in Arch Linux. It was still working in 3.24.1.»

This upstream bug report is available at
https://gitlab.gnome.org/GNOME/simple-scan/issues/30 . We believe this only
happens in "non-traditional" environments. Sebastiaan runs Openbox, I run i3.
The bug probably cannot be witnessed in GNOME/KDE.

After running "git bisect", I was able to understand that commit
ac2f26557e26a2180276724c60864cfa125ac876 is responsible for this regression.
I'm providing a patch that reverts this commit. Upstream does not seem really
interested in this bug, so it might be nice to fix it in the Debian package.


Regards,
Cyril Roelandt.


-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.11.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages simple-scan depends on:
ii  dbus-user-session [default-dbus-session-bus]  1.12.2-1
ii  dbus-x11 [dbus-session-bus]                   1.12.2-1
ii  dconf-gsettings-backend [gsettings-backend]   0.26.1-2
ii  libc6                                         2.25-5
ii  libcairo2                                     1.15.8-2
ii  libcolord2                                    1.3.3-2
ii  libgdk-pixbuf2.0-0                            2.36.11-1
ii  libglib2.0-0                                  2.54.2-3
ii  libgtk-3-0                                    3.22.26-2
ii  libgusb2                                      0.2.11-1
ii  libpackagekit-glib2-18                        1.1.7-1
ii  libsane                                       1.0.25-4.1
ii  xdg-utils                                     1.1.2-1
ii  zlib1g                                        1:1.2.8.dfsg-5

simple-scan recommends no packages.

simple-scan suggests no packages.

-- no debconf information
From 49b4f9f06a3f0fb3d899cdda0aa322a66fe0fd22 Mon Sep 17 00:00:00 2001
From: Cyril Roelandt <[email protected]>
Date: Fri, 24 Nov 2017 17:45:12 +0100
Subject: [PATCH] Revert "Inhibit screensaver while scanning"

This reverts commit ac2f26557e26a2180276724c60864cfa125ac876.
---
 src/meson.build      |  1 -
 src/screensaver.vala | 25 -----------------------
 src/simple-scan.vala | 56 +---------------------------------------------------
 3 files changed, 1 insertion(+), 81 deletions(-)
 delete mode 100644 src/screensaver.vala

diff --git a/src/meson.build b/src/meson.build
index 9e40e42..f0083f9 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -28,7 +28,6 @@ simple_scan = executable ('simple-scan',
                             'preferences-dialog.vala',
                             'simple-scan.vala',
                             'scanner.vala',
-                            'screensaver.vala',
                             'autosave-manager.vala' ] + resources,
                           dependencies: dependencies,
                           vala_args: vala_args,
diff --git a/src/screensaver.vala b/src/screensaver.vala
deleted file mode 100644
index ef2dfb8..0000000
--- a/src/screensaver.vala
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2017 Stéphane Fillion
- * Authors: Stéphane Fillion <[email protected]>
- *
- * This program is free software: you can redistribute it and/or modify it 
under
- * the terms of the GNU General Public License as published by the Free 
Software
- * Foundation, either version 3 of the License, or (at your option) any later
- * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
- * license.
- */
-
-[DBus (name = "org.freedesktop.ScreenSaver")]
-public interface FreedesktopScreensaver : Object
-{
-    public static FreedesktopScreensaver get_proxy () throws IOError
-    {
-        return Bus.get_proxy_sync (BusType.SESSION, 
"org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver");
-    }
-
-    [DBus (name = "Inhibit")]
-    public abstract uint32 inhibit (string application_name, string 
reason_for_inhibit) throws IOError;
-
-    [DBus (name = "UnInhibit")]
-    public abstract void uninhibit (uint32 cookie) throws IOError;
-}
diff --git a/src/simple-scan.vala b/src/simple-scan.vala
index 6e0bab6..7fb5f61 100644
--- a/src/simple-scan.vala
+++ b/src/simple-scan.vala
@@ -38,10 +38,6 @@ public class SimpleScan : Gtk.Application
 
     public SimpleScan (ScanDevice? device = null)
     {
-        /* The inhibit () method use this */
-        Object (application_id: "org.gnome.SimpleScan");
-        register_session = true;
-
         default_device = device;
     }
 
@@ -394,59 +390,9 @@ public class SimpleScan : Gtk.Application
         }
     }
 
-    private uint inhibit_cookie;
-    private FreedesktopScreensaver? fdss;
-
     private void scanner_scanning_changed_cb (Scanner scanner)
     {
-        var is_scanning = scanner.is_scanning ();
-
-        if (is_scanning)
-        {
-            /* Attempt to inhibit the screensaver when scanning */
-            var reason = _("Scan in progress");
-
-            /* This should work on Gnome, Budgie, Cinnamon, Mate, Unity, ...
-             * but will not work on KDE, LXDE, XFCE, ... */
-            inhibit_cookie = inhibit (app, Gtk.ApplicationInhibitFlags.IDLE, 
reason);
-
-            if (!is_inhibited (Gtk.ApplicationInhibitFlags.IDLE))
-            {
-                /* If the previous method didn't work, try the one
-                 * provided by Freedesktop. It should work with KDE,
-                 * LXDE, XFCE, and maybe others as well. */
-                try
-                {
-                    if ((fdss = FreedesktopScreensaver.get_proxy ()) != null)
-                    {
-                        inhibit_cookie = fdss.inhibit ("Simple-Scan", reason);
-                    }
-                }
-                catch (IOError error) {}
-            }
-        }
-        else
-        {
-            /* When finished scanning, uninhibit if inhibit was working */
-            if (inhibit_cookie != 0)
-            {
-                if (fdss == null)
-                        uninhibit (inhibit_cookie);
-                else
-                {
-                    try
-                    {
-                        fdss.uninhibit (inhibit_cookie);
-                    }
-                    catch (IOError error) {}
-                    fdss = null;
-                }
-
-                inhibit_cookie = 0;
-            }
-        }
-
-        app.scanning = is_scanning;
+        app.scanning = scanner.is_scanning ();
     }
 
     private void scan_cb (AppWindow ui, string? device, ScanOptions options)
-- 
2.15.1

Reply via email to