[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 42/473: Fix issues with detecting when to grab pointer.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:53:32 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit ae45b01bcd45c40fbe7b60bbfa3979c637f5fad1
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Jun 29 15:23:54 2013 -0400

    Fix issues with detecting when to grab pointer.
---
 src/menu.cpp |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/menu.cpp b/src/menu.cpp
index 45b31bc..418a058 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -448,6 +448,13 @@ void Menu::unset_items()
 
 gboolean Menu::on_enter_notify_event(GtkWidget*, GdkEventCrossing* event)
 {
+	if ( (event->detail == GDK_NOTIFY_INFERIOR)
+			|| (event->mode == GDK_CROSSING_GRAB)
+			|| (event->mode == GDK_CROSSING_GTK_GRAB) )
+	{
+		return false;
+	}
+
 	// Don't grab cursor over menu
 	if ((event->x_root >= m_geometry.x) && (event->x_root < (m_geometry.x + m_geometry.width))
 			&& (event->y_root >= m_geometry.y) && (event->y_root < (m_geometry.y + m_geometry.height)))
@@ -465,7 +472,8 @@ gboolean Menu::on_enter_notify_event(GtkWidget*, GdkEventCrossing* event)
 
 gboolean Menu::on_leave_notify_event(GtkWidget*, GdkEventCrossing* event)
 {
-	if (gdk_pointer_is_grabbed())
+	if ( (event->detail == GDK_NOTIFY_INFERIOR)
+			|| (event->mode != GDK_CROSSING_NORMAL) )
 	{
 		return false;
 	}
@@ -574,6 +582,8 @@ gboolean Menu::on_configure_event(GtkWidget*, GdkEventConfigure* event)
 {
 	if (event->width && event->height)
 	{
+		m_geometry.x = event->x;
+		m_geometry.y = event->y;
 		m_geometry.width = event->width;
 		m_geometry.height = event->height;
 	}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list