[xdg-desktop-portal-gnome] remote-desktop: Only ask for streams if SelectSources was called



commit cd6205503518d1b9c18378c0678e6270951c4f62
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Mar 15 09:54:25 2022 +0100

    remote-desktop: Only ask for streams if SelectSources was called
    
    The remote desktop dialog has a screen cast widget in case remote
    desktop session was made into a hybrid remote desktop / screen cast
    session by calling org.freedesktop.portal.ScreenCast.SelectSources on
    the remote desktop session object.
    
    This was done by checking the selected screen cast list elements when
    the dialog was done. With the port to GTK4 items were selected by
    default; what this accidentally resulted in was the remote desktop
    always attempting to open screen cast streams without the user ever
    having seen the widget, as even if it wasn't made visible, it was still
    constructed as part of the template, only not made visible.
    
    Fix this by only attempting to create streams if the SelectSources
    method had been called.
    
    Reported-by: Jan Grulich <jgrulich redhat com>
    Fixes: 0f6957254e32ab6dc1c132c0f7623bbac31309f6

 src/remotedesktopdialog.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/remotedesktopdialog.c b/src/remotedesktopdialog.c
index 48bb018..83cd1f7 100644
--- a/src/remotedesktopdialog.c
+++ b/src/remotedesktopdialog.c
@@ -84,7 +84,8 @@ button_clicked (GtkWidget *button,
 
       response = GTK_RESPONSE_OK;
       device_types = get_selected_device_types (dialog);
-      streams = screen_cast_widget_get_selected_streams (screen_cast_widget);
+      if (dialog->screen_cast_enable)
+        streams = screen_cast_widget_get_selected_streams (screen_cast_widget);
     }
   else
     {


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