aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2005-12-12 08:08:43 +0000
committerJan Djärv2005-12-12 08:08:43 +0000
commitb79c8219e88f33e55a58789e4ea42f3c2b23c728 (patch)
treeb02b3cce6598d12638e4957ee60425fbbef15324 /src
parent3b006f5b674c605bb7951fec5212e600fade2394 (diff)
downloademacs-b79c8219e88f33e55a58789e4ea42f3c2b23c728.tar.gz
emacs-b79c8219e88f33e55a58789e4ea42f3c2b23c728.zip
* xmenu.c (menubar_selection_callback): Do nothing if the callback
is for an unselected radio menu item.
Diffstat (limited to 'src')
-rw-r--r--src/xmenu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index 184ff2c8c47..468462a6ceb 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1572,6 +1572,15 @@ menubar_selection_callback (widget, client_data)
1572 if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f) 1572 if (! cb_data || ! cb_data->cl_data || ! cb_data->cl_data->f)
1573 return; 1573 return;
1574 1574
1575 /* For a group of radio buttons, GTK calls the selection callback first
1576 for the item that was active before the selection and then for the one that
1577 is active after the selection. For C-h k this means we get the help on
1578 the deselected item and then the selected item is executed. Prevent that
1579 by ignoring the non-active item. */
1580 if (GTK_IS_RADIO_MENU_ITEM (widget)
1581 && ! gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget)))
1582 return;
1583
1575 /* When a menu is popped down, X generates a focus event (i.e. focus 1584 /* When a menu is popped down, X generates a focus event (i.e. focus
1576 goes back to the frame below the menu). Since GTK buffers events, 1585 goes back to the frame below the menu). Since GTK buffers events,
1577 we force it out here before the menu selection event. Otherwise 1586 we force it out here before the menu selection event. Otherwise
@@ -1891,7 +1900,7 @@ update_submenu_strings (first_wv)
1891 { 1900 {
1892 if (STRINGP (wv->lname)) 1901 if (STRINGP (wv->lname))
1893 { 1902 {
1894 wv->name = SDATA (wv->lname); 1903 wv->name = (char *) SDATA (wv->lname);
1895 1904
1896 /* Ignore the @ that means "separate pane". 1905 /* Ignore the @ that means "separate pane".
1897 This is a kludge, but this isn't worth more time. */ 1906 This is a kludge, but this isn't worth more time. */
@@ -1904,7 +1913,7 @@ update_submenu_strings (first_wv)
1904 } 1913 }
1905 1914
1906 if (STRINGP (wv->lkey)) 1915 if (STRINGP (wv->lkey))
1907 wv->key = SDATA (wv->lkey); 1916 wv->key = (char *) SDATA (wv->lkey);
1908 1917
1909 if (wv->contents) 1918 if (wv->contents)
1910 update_submenu_strings (wv->contents); 1919 update_submenu_strings (wv->contents);