[gnome-games/wip/exalm/ui4: 1/3] fullscreen-box: Only reveal headerbar when cursor is nearby



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

    fullscreen-box: Only reveal headerbar when cursor is nearby
    
    Match libdazzle behavior by only revealing headerbar 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 73e83f38..1b45198a 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]