- if (touchscreen_mode &&
- priv->active_menu_item &&
- GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu &&
- gtk_widget_get_visible (GTK_MENU_ITEM (priv->active_menu_item)->priv->submenu))
- {
- /* if we are on a menu item that has an open submenu but the
- * focus is not in that submenu (e.g. because it's empty or
- * has only insensitive items), close that submenu instead of
- * running into the code below which would close *this* menu.
- */
- _gtk_menu_item_popdown_submenu (priv->active_menu_item);
- _gtk_menu_shell_update_mnemonics (menu_shell);
- }
- else if (parent_menu_shell)