[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 06/37: Fix window being draggable. (bug #11908)

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:35:50 CEST 2016


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

gottcode pushed a commit to annotated tag v1.5.1
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 408863b73d664a121600e26232384fb52b43dbb2
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sun Jun 14 14:09:38 2015 -0400

    Fix window being draggable. (bug #11908)
---
 panel-plugin/window.cpp | 36 ++++++++++++------------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 70e6ab0..9c5a414 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -643,17 +643,12 @@ gboolean WhiskerMenu::Window::on_enter_notify_event(GtkWidget*, GdkEvent* event)
 		return false;
 	}
 
-	// Don't grab cursor over menu
-	if ((crossing_event->x_root >= m_geometry.x)
-			&& (crossing_event->x_root < (m_geometry.x + m_geometry.width))
-			&& (crossing_event->y_root >= m_geometry.y)
-			&& (crossing_event->y_root < (m_geometry.y + m_geometry.height)))
-	{
-		if (gdk_pointer_is_grabbed())
-		{
-			gdk_pointer_ungrab(crossing_event->time);
-		}
-	}
+	gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(m_window)), true,
+			GdkEventMask(
+				GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+				GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
+			),
+			NULL, NULL, crossing_event->time);
 
 	return false;
 }
@@ -669,19 +664,12 @@ gboolean WhiskerMenu::Window::on_leave_notify_event(GtkWidget*, GdkEvent* event)
 		return false;
 	}
 
-	// Track mouse clicks outside of menu
-	if ((crossing_event->x_root <= m_geometry.x)
-			|| (crossing_event->x_root >= m_geometry.x + m_geometry.width)
-			|| (crossing_event->y_root <= m_geometry.y)
-			|| (crossing_event->y_root >= m_geometry.y + m_geometry.height))
-	{
-		gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(m_window)), true,
-				GdkEventMask(
-					GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
-					GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
-				),
-				NULL, NULL, crossing_event->time);
-	}
+	gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(m_window)), true,
+			GdkEventMask(
+				GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+				GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
+			),
+			NULL, NULL, crossing_event->time);
 
 	return false;
 }

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


More information about the Xfce4-commits mailing list