[gnome-shell/gnome-3-36] screenshot: Properly clean up if PickColor() is cancelled



commit 99ebef504d127d10793ae3a20701ffa83db82e51
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri May 29 00:27:34 2020 +0200

    screenshot: Properly clean up if PickColor() is cancelled
    
    We currently only remove the screenshot operation from the shooter
    map if the color pick operation completed successfully, but not if
    it was cancelled. As a result, we now reject any further requests
    from the same sender because we assume that there is an ongoing
    operation.
    
    Fix this by moving the cleanup to a finally clause that runs for
    both code paths.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1288

 js/ui/screenshot.js | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 6f88e1a203..df5746e1fd 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -292,6 +292,8 @@ var ScreenshotService = class {
             invocation.return_error_literal(
                 Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
                 'Operation was cancelled');
+        } finally {
+            this._removeShooterForSender(invocation.get_sender());
         }
     }
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]