[gnome-games/wip/exalm/ui4: 3/7] fullscreen-box: Only reveal header bar when cursor is nearby



commit 1db7509d66b72059341e9555da6ab2d8bb755623
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Thu Jun 6 01:08:53 2019 +0500

    fullscreen-box: Only reveal header bar when cursor is nearby
    
    Match libdazzle behavior by only revealing the header bar when cursor is
    closer to the top of the screen than 5px.

 src/ui/fullscreen-box.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/fullscreen-box.vala b/src/ui/fullscreen-box.vala
index d2d04010..16e1d3b4 100644
--- a/src/ui/fullscreen-box.vala
+++ b/src/ui/fullscreen-box.vala
@@ -3,6 +3,7 @@
 [GtkTemplate (ui = "/org/gnome/Games/ui/fullscreen-box.ui")]
 private class Games.FullscreenBox : Gtk.EventBox, Gtk.Buildable {
        private const uint INACTIVITY_TIME_MILLISECONDS = 2000;
+       private const int SHOW_HEADERBAR_DISTANCE = 5;
 
        public bool is_fullscreen { get; set; }
 
@@ -68,7 +69,8 @@ private class Games.FullscreenBox : Gtk.EventBox, Gtk.Buildable {
 
        [GtkCallback]
        private bool on_motion_event (Gdk.EventMotion event) {
-               on_activity ();
+               if (event.y_root <= SHOW_HEADERBAR_DISTANCE)
+                       on_activity ();
 
                return false;
        }


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