Commit 1a3b0b48 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

pop up the submenu explicitely only in touchscreen mode since otherwise

2007-04-30  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): pop up the
	submenu explicitely only in touchscreen mode since otherwise
	selecting the item already pops up the submenu. Restores the
	drag-selection timeout (spotted by Søren Sandmann, #128968).


svn path=/trunk/; revision=17735
parent 2e184ceb
2007-04-30 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenushell.c (gtk_menu_shell_enter_notify): pop up the
submenu explicitely only in touchscreen mode since otherwise
selecting the item already pops up the submenu. Restores the
drag-selection timeout (spotted by Søren Sandmann, #128968).
2007-04-30 Michael Natterer <mitch@imendio.com>
* gtk/gtkpapersize.h: really rename gtk_paper_size_get_builtins()
......
......@@ -810,17 +810,25 @@ gtk_menu_shell_enter_notify (GtkWidget *widget,
* entering a menu item where we wouldn't want to show
* its submenu.
*/
if ((event->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON2_MASK)) &&
GTK_MENU_ITEM (menu_item)->submenu != NULL &&
!GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
if ((event->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) &&
GTK_MENU_ITEM (menu_item)->submenu != NULL)
{
GtkMenuShellPrivate *priv;
priv = GTK_MENU_SHELL_GET_PRIVATE (menu_item->parent);
priv->activated_submenu = TRUE;
_gtk_menu_item_popup_submenu (menu_item, TRUE);
if (!GTK_WIDGET_VISIBLE (GTK_MENU_ITEM (menu_item)->submenu))
{
gboolean touchscreen_mode;
priv->activated_submenu = TRUE;
g_object_get (gtk_widget_get_settings (widget),
"gtk-touchscreen-mode", &touchscreen_mode,
NULL);
if (touchscreen_mode)
_gtk_menu_item_popup_submenu (menu_item, TRUE);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment