[gnome-games] display-box: Don't hide cursor with opened popovers in windowed mode



commit 8c5c6abfb43433b574bc1e469990b6d5ff951518
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Mar 27 00:08:54 2020 +0500

    display-box: Don't hide cursor with opened popovers in windowed mode
    
    While it was fixed for fullscreen, it was still an issue in the regular
    window.

 src/ui/display-box.vala  | 5 ++++-
 src/ui/display-view.vala | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/display-box.vala b/src/ui/display-box.vala
index b915c438..45b46cc9 100644
--- a/src/ui/display-box.vala
+++ b/src/ui/display-box.vala
@@ -51,6 +51,7 @@ private class Games.DisplayBox : Gtk.Bin {
 
        public bool can_fullscreen { get; set; }
        public string game_title { get; set; }
+       public bool is_menu_open { get; set; }
 
        [GtkChild]
        private Gtk.Stack stack;
@@ -84,7 +85,9 @@ private class Games.DisplayBox : Gtk.Bin {
 
        [GtkCallback]
        public void block_autohide_changed () {
-               fullscreen_box.autohide = !fullscreen_header_bar.is_menu_open && !is_showing_snapshots;
+               fullscreen_box.autohide = !is_menu_open &&
+                                         !fullscreen_header_bar.is_menu_open &&
+                                         !is_showing_snapshots;
        }
 
        [GtkCallback]
diff --git a/src/ui/display-view.vala b/src/ui/display-view.vala
index 20a4e274..729d22a6 100644
--- a/src/ui/display-view.vala
+++ b/src/ui/display-view.vala
@@ -107,6 +107,10 @@ private class Games.DisplayView : Object, UiView {
                bind_property ("game-title", header_bar,
                               "game-title", BindingFlags.BIDIRECTIONAL);
 
+               header_bar.notify["is-menu-open"].connect (() => {
+                       box.is_menu_open = header_bar.is_menu_open;
+               });
+
                focus_out_timeout_id = -1;
 
                action_group = new SimpleActionGroup ();


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