[xdg-desktop-portal-gnome] Fix titlebar visibility with virtual monitors



commit 682c017bb611216301f0794aa98d7c2b4ac1d123
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Nov 22 12:02:26 2021 -0300

    Fix titlebar visibility with virtual monitors
    
    Virtual monitors and monitors are now a single page, so checking
    the popcount is not enough - it'll return 2 if VIRTUAL | MONITOR
    was passed, but in fact only a single page is visible.
    
    Fix that by checking if a WINDOW type is passed to, which will
    in fact cause two pages of the stack to be visible.

 src/remotedesktopdialog.c | 3 ++-
 src/screencastdialog.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/remotedesktopdialog.c b/src/remotedesktopdialog.c
index 24b9f61..48bb018 100644
--- a/src/remotedesktopdialog.c
+++ b/src/remotedesktopdialog.c
@@ -163,7 +163,8 @@ remote_desktop_dialog_new (const char *app_id,
                         G_CALLBACK (on_has_selection_changed), dialog);
       gtk_widget_show (GTK_WIDGET (screen_cast_widget));
 
-      if (__builtin_popcount (screen_cast_select->source_types) > 1)
+      if (__builtin_popcount (screen_cast_select->source_types) > 1 &&
+          (screen_cast_select->source_types & SCREEN_CAST_SOURCE_TYPE_WINDOW))
         {
           gtk_header_bar_set_title_widget (dialog->titlebar,
                                            screen_cast_widget_get_stack_switcher (screen_cast_widget));
diff --git a/src/screencastdialog.c b/src/screencastdialog.c
index e36d126..de5f741 100644
--- a/src/screencastdialog.c
+++ b/src/screencastdialog.c
@@ -165,7 +165,8 @@ screen_cast_dialog_new (const char            *app_id,
                                        select->source_types);
   screen_cast_widget_set_persist_mode (screen_cast_widget, persist_mode);
 
-  if (__builtin_popcount (select->source_types) > 1)
+  if (__builtin_popcount (select->source_types) > 1 &&
+      (select->source_types & SCREEN_CAST_SOURCE_TYPE_WINDOW))
     {
       ScreenCastWidget *widget = SCREEN_CAST_WIDGET (dialog->screen_cast_widget);
       gtk_header_bar_set_title_widget (dialog->titlebar,


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