[gnome-boxes] display-page: Don't reveal topbar on pointer over edges



commit 5aaf352588c173e93f46e93a825f4f9aa1f2c258
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu May 22 19:25:14 2014 +0100

    display-page: Don't reveal topbar on pointer over edges
    
    Seems all modern operating systems (GNOME, Windows 8, OS X) reserve
    'pointer on edges' as gentures for different UIs. Lets try out best not to
    interfer with that by only revealing overlaybar when pointer is around the
    top center of the screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674664

 src/display-page.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/display-page.vala b/src/display-page.vala
index aeba726..2578cb6 100644
--- a/src/display-page.vala
+++ b/src/display-page.vala
@@ -4,6 +4,8 @@ using Gdk;
 
 [GtkTemplate (ui = "/org/gnome/Boxes/ui/display-page.ui")]
 private class Boxes.DisplayPage: Gtk.Box {
+    private const uint8 SCREEN_EDGE_WIDTH = 80;
+
     [GtkChild]
     public DisplayToolbar toolbar;
 
@@ -168,8 +170,10 @@ private class Boxes.DisplayPage: Gtk.Box {
     [GtkCallback]
     private bool on_event_box_event (Gdk.Event event) {
         if (App.window.fullscreened && event.type == EventType.MOTION_NOTIFY) {
+            var x = event.motion.x;
             var y = event.motion.y;
-            if (y <= 0 && toolbar_show_id == 0) {
+            if (x >= SCREEN_EDGE_WIDTH && x <= (get_allocated_width () - SCREEN_EDGE_WIDTH) &&
+                y <= 0 && toolbar_show_id == 0) {
                 toolbar_event_stop ();
                 if ((event.motion.state &
                      (ModifierType.SHIFT_MASK | ModifierType.CONTROL_MASK |


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