[gtk+] popover: Be lenient wrt visibility of popovers too close to widget borders



commit 2be6d09c9ea7341478ac699c144178c2a001a197
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 12 11:59:47 2015 +0200

    popover: Be lenient wrt visibility of popovers too close to widget borders
    
    The check used to hide the popover if the pointed area fell partly out of
    the widget allocation, textviews now can trigger that with text selections
    too close to the visible edge, as a small extra area around is now reserved.
    
    The check has been changed to only hide the popover if the pointed area
    falls completely outside the widget allocation.

 gtk/gtkpopover.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index c156f8b..1807d65 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -925,8 +925,8 @@ _gtk_popover_update_child_visible (GtkPopover *popover)
 
   gtk_widget_get_allocation (GTK_WIDGET (parent), &allocation);
 
-  if (rect.x < 0 || rect.x + rect.width > allocation.width ||
-      rect.y < 0 || rect.y + rect.height > allocation.height)
+  if (rect.x + rect.width < 0 || rect.x > allocation.width ||
+      rect.y + rect.height < 0 || rect.y > allocation.height)
     gtk_widget_set_child_visible (widget, FALSE);
   else
     gtk_widget_set_child_visible (widget, TRUE);


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