[gnome-shell] iconGrid: Bail out when not on a monitor



commit 4b4d422c1e865d5f2dac2b6e94e9939bbb7301e8
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Aug 13 03:21:47 2021 +0200

    iconGrid: Bail out when not on a monitor
    
    There shouldn't be any code that calls zoomOutActor() without
    a monitor, but throwing in an early return doesn't hurt.
    
    CID 351285.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>

 js/ui/iconGrid.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index efc638913e..65b130ce74 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -193,6 +193,10 @@ function zoomOutActor(actor) {
 }
 
 function zoomOutActorAtPos(actor, x, y) {
+    const monitor = Main.layoutManager.findMonitorForActor(actor);
+    if (!monitor)
+        return;
+
     const actorClone = new Clutter.Clone({
         source: actor,
         reactive: false,
@@ -207,7 +211,6 @@ function zoomOutActorAtPos(actor, x, y) {
     Main.uiGroup.add_actor(actorClone);
 
     // Avoid monitor edges to not zoom outside the current monitor
-    let monitor = Main.layoutManager.findMonitorForActor(actor);
     let scaledWidth = width * APPICON_ANIMATION_OUT_SCALE;
     let scaledHeight = height * APPICON_ANIMATION_OUT_SCALE;
     let scaledX = x - (scaledWidth - width) / 2;


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