[xdg-desktop-portal-gnome/gnome-42] screencast: Ref listeners when acquiring windows list



commit 4ae2a786673d8db8c9817423f9539531982abbd0
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Aug 4 22:18:37 2022 -0300

    screencast: Ref listeners when acquiring windows list
    
    This is not enough to fix [1], but it's a necessary step towards
    that. This implicitly calls sync_state(), which we'll depend on
    later.
    
    [1] https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/49

 src/screencast.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/screencast.c b/src/screencast.c
index 13770d9..a7e96b7 100644
--- a/src/screencast.c
+++ b/src/screencast.c
@@ -443,6 +443,8 @@ find_best_window_by_app_id_and_title (const char *app_id,
   best_match = NULL;
   best_match_distance = G_MAXLONG;
 
+  shell_introspect_ref_listeners (shell_introspect);
+
   windows = shell_introspect_get_windows (shell_introspect);
   for (size_t i = 0; windows && i < windows->len; i++)
     {
@@ -464,6 +466,8 @@ find_best_window_by_app_id_and_title (const char *app_id,
         }
     }
 
+  shell_introspect_unref_listeners (shell_introspect);
+
   /* If even the best match's window title is too different, don't
    * restore it.
    */


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