summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-05-24 15:02:58 +0300
committerlukefromdc <[email protected]>2017-05-30 13:41:14 -0400
commita94e7d192e39fda1d5bba1921c676fec699ac533 (patch)
tree656044c7000b6f22fa886dc0bfee91510ce3c3ed
parentc27ba68a23fed89c9b9065c7ddd9cbfa3dee5095 (diff)
downloadmate-panel-a94e7d192e39fda1d5bba1921c676fec699ac533.tar.bz2
mate-panel-a94e7d192e39fda1d5bba1921c676fec699ac533.tar.xz
menu: remove incorrect code from the popup menu of a menuitem
fixes https://github.com/mate-desktop/mate-panel/issues/305
-rw-r--r--mate-panel/menu.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/mate-panel/menu.c b/mate-panel/menu.c
index 05cba577..e44933b6 100644
--- a/mate-panel/menu.c
+++ b/mate-panel/menu.c
@@ -417,71 +417,6 @@ add_menu_to_panel (GtkWidget *menuitem,
matemenu_tree_item_unref (directory);
}
-/*most of this function stolen from the real gtk_menu_popup*/
-static void
-restore_grabs(GtkWidget *w, gpointer data)
-{
- GtkWidget *menu_item = data;
- GtkMenu *menu = GTK_MENU (gtk_widget_get_parent (menu_item));
- GtkWidget *xgrab_shell;
- GtkWidget *parent;
-
- /* Find the last viewable ancestor, and make an X grab on it
- */
- parent = GTK_WIDGET (menu);
- xgrab_shell = NULL;
- while (parent) {
- gboolean viewable = TRUE;
- GtkWidget *tmp = parent;
-
- while (tmp) {
- if (!gtk_widget_get_mapped (tmp)) {
- viewable = FALSE;
- break;
- }
- tmp = gtk_widget_get_parent (tmp);
- }
-
- if (viewable)
- xgrab_shell = parent;
-
- parent = gtk_menu_shell_get_parent_shell (GTK_MENU_SHELL (parent));
- }
-
- /*only grab if this HAD a grab before*/
- /* FIXME fix for GTK3 */
-#if 0
- if (xgrab_shell && (GTK_MENU_SHELL (xgrab_shell)->have_xgrab))
- {
- GdkWindow *window = gtk_widget_get_window (xgrab_shell);
-
- if (gdk_pointer_grab (window, TRUE,
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_ENTER_NOTIFY_MASK |
- GDK_LEAVE_NOTIFY_MASK,
- NULL, NULL, 0) == 0)
- {
- if (gdk_keyboard_grab (window, TRUE,
- GDK_CURRENT_TIME) == 0)
- GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE;
- else
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
- }
- }
-#endif
-
- gtk_grab_add (GTK_WIDGET (menu));
-}
-
-static void
-menu_destroy_context_menu (GtkWidget *item,
- GtkWidget *menu)
-{
- g_signal_handlers_disconnect_by_func (menu, restore_grabs, item);
- gtk_widget_destroy (menu);
-}
-
static GtkWidget *
create_item_context_menu (GtkWidget *item,
PanelWidget *panel_widget)
@@ -519,11 +454,6 @@ create_item_context_menu (GtkWidget *item,
g_object_set_data (G_OBJECT (item), "panel-item-context-menu", menu);
g_object_set_data (G_OBJECT (menu), "menu_panel", panel_widget);
- g_signal_connect (item, "destroy",
- G_CALLBACK (menu_destroy_context_menu), menu);
- g_signal_connect (menu, "deactivate",
- G_CALLBACK (restore_grabs), item);
-
menuitem = gtk_menu_item_new_with_mnemonic (_("Add this launcher to _panel"));
g_signal_connect (menuitem, "activate",
G_CALLBACK (add_app_to_panel), entry);