[gnome-shell/gnome-3-38] windowPreview: Handle case where window already is part of layout



commit c5c7e1d1ec86ba8e5671cfd04ce99e8dc8ddbbb0
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sat Oct 24 20:51:56 2020 +0200

    windowPreview: Handle case where window already is part of layout
    
    We sometimes add dialogs multiple times to the WindowPreview, for
    example for modal dialogs we receive both the "window-added" and the
    "window-entered-monitor" signal, which means we call
    WindowPreview.addDialog() twice.
    
    We handle that fine already in the WindowPreviewLayout and return NULL
    in case the window already was added, so simply handle that NULL return
    value and bail out of WindowPreview.addDialog() in this case.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1482
    
    (cherry picked from commit 0b2430128a4d34bcb0e8a5d79a731ce05c4e084c)

 js/ui/windowPreview.js | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js
index 5630ba5e31..d379703dd8 100644
--- a/js/ui/windowPreview.js
+++ b/js/ui/windowPreview.js
@@ -500,6 +500,8 @@ var WindowPreview = GObject.registerClass({
 
     _addWindow(metaWindow) {
         const clone = this._windowContainer.layout_manager.addWindow(metaWindow);
+        if (!clone)
+            return;
 
         // We expect this to be used for all interaction rather than
         // the ClutterClone; as the former is reactive and the latter


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