diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2008-07-24 08:36:26 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2008-07-24 08:36:26 +0000 |
commit | d1c38b5722b1beec983b801a3fbd60b9483bceb5 (patch) | |
tree | c19c1706c74b75a1a46ba7083827dab63f799611 /src/gtkutil.c | |
parent | bd419dfa0788f5062a2c98ee9871ea2483874fde (diff) | |
download | emacs-d1c38b5722b1beec983b801a3fbd60b9483bceb5.tar.gz |
(xg_get_font_name): Cast w to GTK_FONT_SELECTION_DIALOG.
(menu_nav_ended): Remove.
(create_menus): Remove signal connect for menu_nav_ended.
(xg_update_menubar): Also take deactivate_cb as parameter, pass it to
create_menus.
(xg_modify_menubar_widgets): Pass deactivate_cb to xg_update_menubar.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 53 |
1 files changed, 11 insertions, 42 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 578e9737f39..7e2a05eed89 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1648,7 +1648,8 @@ xg_get_font_name (f, default_name) w = gtk_font_selection_dialog_new ("Pick a font"); if (default_name) - gtk_font_selection_dialog_set_font_name (w, default_name); + gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (w), + default_name); xg_set_screen (w, f); gtk_widget_set_name (w, "emacs-fontdialog"); @@ -1692,9 +1693,9 @@ xg_get_font_name (f, default_name) Menu functions. ***********************************************************************/ -/* The name of menu items that can be used for citomization. Since GTK +/* The name of menu items that can be used for customization. Since GTK RC files are very crude and primitive, we have to set this on all - menu item names so a user can easily cutomize menu items. */ + menu item names so a user can easily customize menu items. */ #define MENU_ITEM_NAME "emacs-menuitem" @@ -2138,34 +2139,6 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) return w; } -/* Callback called when keyboard traversal (started by x-menu-bar-open) ends. - WMENU is the menu for which traversal has been done. DATA points to the - frame for WMENU. We must release grabs, some bad interaction between GTK - and Emacs makes the menus keep the grabs. */ - -static void -menu_nav_ended (wmenu, data) - GtkMenuShell *wmenu; - gpointer data; -{ - FRAME_PTR f = (FRAME_PTR) data; - - if (FRAME_X_OUTPUT (f)->menubar_widget) - { - GtkMenuShell *w = GTK_MENU_SHELL (FRAME_X_OUTPUT (f)->menubar_widget); - Display *dpy = FRAME_X_DISPLAY (f); - - BLOCK_INPUT; - gtk_menu_shell_deactivate (w); - gtk_menu_shell_deselect (w); - - XUngrabKeyboard (dpy, CurrentTime); - XUngrabPointer (dpy, CurrentTime); - UNBLOCK_INPUT; - } -} - - static GtkWidget *create_menus P_ ((widget_value *, FRAME_PTR, GCallback, GCallback, GCallback, int, int, int, GtkWidget *, xg_menu_cb_data *, char *)); @@ -2231,12 +2204,6 @@ create_menus (data, f, select_cb, deactivate_cb, highlight_cb, } else wmenu = gtk_menu_bar_new (); - /* Fix up grabs after keyboard traversal ends. */ - g_signal_connect (G_OBJECT (wmenu), - "selection-done", - G_CALLBACK (menu_nav_ended), - f); - /* Put cl_data on the top menu for easier access. */ cl_data = make_cl_data (cl_data, f, highlight_cb); g_object_set_data (G_OBJECT (wmenu), XG_FRAME_DATA, (gpointer)cl_data); @@ -2456,7 +2423,7 @@ xg_destroy_widgets (list) static void xg_update_menubar (menubar, f, list, iter, pos, val, - select_cb, highlight_cb, cl_data) + select_cb, deactivate_cb, highlight_cb, cl_data) GtkWidget *menubar; FRAME_PTR f; GList **list; @@ -2464,6 +2431,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, int pos; widget_value *val; GCallback select_cb; + GCallback deactivate_cb; GCallback highlight_cb; xg_menu_cb_data *cl_data; { @@ -2481,7 +2449,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, else if (! iter && val) { /* Item(s) added. Add all new items in one call. */ - create_menus (val, f, select_cb, 0, highlight_cb, + create_menus (val, f, select_cb, deactivate_cb, highlight_cb, 0, 1, 0, menubar, cl_data, 0); /* All updated. */ @@ -2588,7 +2556,8 @@ xg_update_menubar (menubar, f, list, iter, pos, val, /* Create a possibly empty submenu for menu bar items, since some themes don't highlight items correctly without it. */ GtkWidget *submenu = create_menus (NULL, f, - select_cb, NULL, highlight_cb, + select_cb, deactivate_cb, + highlight_cb, 0, 0, 0, 0, cl_data, 0); gtk_widget_set_name (w, MENU_ITEM_NAME); gtk_menu_shell_insert (GTK_MENU_SHELL (menubar), w, pos); @@ -2626,7 +2595,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, /* Update the rest of the menu bar. */ xg_update_menubar (menubar, f, list, iter, pos, val, - select_cb, highlight_cb, cl_data); + select_cb, deactivate_cb, highlight_cb, cl_data); } /* Update the menu item W so it corresponds to VAL. @@ -2931,7 +2900,7 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p, XG_FRAME_DATA); xg_update_menubar (menubar, f, &list, list, 0, val->contents, - select_cb, highlight_cb, cl_data); + select_cb, deactivate_cb, highlight_cb, cl_data); if (deep_p) { |