[gtk+/touch-for-3.4] menu: Only look at direct touch devices for now
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touch-for-3.4] menu: Only look at direct touch devices for now
- Date: Fri, 24 Feb 2012 20:14:58 +0000 (UTC)
commit 4becb951927637ca15e94ed3f8367299178d67ea
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 24 14:36:02 2012 -0500
menu: Only look at direct touch devices for now
gtk/gtkmenu.c | 16 ++++++++--------
gtk/gtkmenuitem.c | 2 +-
gtk/gtkmenushell.c | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 3e4e86b..3f0d40d 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1677,7 +1677,7 @@ gtk_menu_popup_for_device (GtkMenu *menu,
/* if no item is selected, select the first one */
if (!menu_shell->priv->active_menu_item &&
- source_device && gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
+ source_device && gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
gtk_menu_shell_select_first (menu_shell, TRUE);
/* Once everything is set up correctly, map the toplevel */
@@ -3372,7 +3372,7 @@ gtk_menu_button_press (GtkWidget *widget,
return TRUE;
if (GTK_IS_MENU_ITEM (event_widget) &&
- gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH &&
+ gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH &&
GTK_MENU_ITEM (event_widget)->priv->submenu != NULL &&
!gtk_widget_is_drawable (GTK_MENU_ITEM (event_widget)->priv->submenu))
menu->priv->ignore_button_release = TRUE;
@@ -3645,7 +3645,7 @@ gtk_menu_motion_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
if (GTK_IS_MENU (widget) &&
- gdk_device_get_source (source_device) != GDK_SOURCE_TOUCH)
+ gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
{
GtkMenuPrivate *priv = GTK_MENU(widget)->priv;
@@ -4113,7 +4113,7 @@ gtk_menu_enter_notify (GtkWidget *widget,
menu_item = gtk_get_event_widget ((GdkEvent*) event);
if (GTK_IS_MENU (widget) &&
- gdk_device_get_source (source_device) != GDK_SOURCE_TOUCH)
+ gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
{
GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
@@ -4122,7 +4122,7 @@ gtk_menu_enter_notify (GtkWidget *widget,
event->x_root, event->y_root, TRUE, TRUE);
}
- if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCH &&
+ if (gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH &&
GTK_IS_MENU_ITEM (menu_item))
{
GtkWidget *menu = gtk_widget_get_parent (menu_item);
@@ -4195,7 +4195,7 @@ gtk_menu_leave_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
- if (gdk_device_get_source (source_device) != GDK_SOURCE_TOUCH)
+ if (gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH)
gtk_menu_handle_scrolling (menu, event->x_root, event->y_root, FALSE, TRUE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
@@ -4272,7 +4272,7 @@ gtk_menu_captured_event (GtkWidget *widget,
{
case GDK_BUTTON_PRESS:
if (event->button.button == 1 &&
- gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH &&
+ gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH &&
pointer_on_menu_widget (menu, event->button.x_root, event->button.y_root))
{
priv->drag_start_y = event->button.y_root;
@@ -4295,7 +4295,7 @@ gtk_menu_captured_event (GtkWidget *widget,
break;
case GDK_MOTION_NOTIFY:
if (event->motion.state & GDK_BUTTON1_MASK &&
- gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
+ gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
{
if (!priv->drag_already_pressed)
{
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 259ccc3..cc92824 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1702,7 +1702,7 @@ gtk_real_menu_item_select (GtkMenuItem *menu_item)
}
if ((!source_device ||
- gdk_device_get_source (source_device) != GDK_SOURCE_TOUCH) &&
+ gdk_device_get_source (source_device) != GDK_SOURCE_DIRECT_TOUCH) &&
priv->submenu &&
(!gtk_widget_get_mapped (priv->submenu) ||
GTK_MENU (priv->submenu)->priv->tearoff_active))
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 56baf96..5e541af 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1088,7 +1088,7 @@ gtk_menu_shell_enter_notify (GtkWidget *widget,
source_device = gdk_event_get_source_device ((GdkEvent *) event);
- if (gdk_device_get_source (source_device) == GDK_SOURCE_TOUCH)
+ if (gdk_device_get_source (source_device) == GDK_SOURCE_DIRECT_TOUCH)
_gtk_menu_item_popup_submenu (menu_item, TRUE);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]