summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-20 21:55:45 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-20 21:55:45 +0000
commit9b2200acd6bd572eea00ea89eeb3b2c0764c8942 (patch)
tree2b51ab147338ddbae29d5586eb06ed85dd58ea00 /src/gui_gtk.c
parent0126585dbb2a044ec2d72166dbc71cec33517194 (diff)
updated for version 7.0230
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r--src/gui_gtk.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index cdd645b659..a1c43751b4 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -320,6 +320,19 @@ create_menu_icon(vimmenu_T *menu, GtkIconSize icon_size)
return image;
}
+/*ARGSUSED*/
+ static gint
+toolbar_button_focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
+{
+ /* When we're in a GtkPlug, we don't have window focus events, only widget focus.
+ * To emulate stand-alone gvim, if a button gets focus (e.g., <Tab> into GtkPlug)
+ * immediately pass it to mainwin.
+ */
+ if (gtk_socket_id != 0)
+ gtk_widget_grab_focus(gui.drawarea);
+
+ return TRUE;
+}
#endif /* FEAT_TOOLBAR && HAVE_GTK2 */
#if (defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)) || defined(PROTO)
@@ -767,6 +780,10 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
menu,
idx);
+ if (gtk_socket_id != 0)
+ gtk_signal_connect(GTK_OBJECT(menu->id), "focus_in_event",
+ GTK_SIGNAL_FUNC(toolbar_button_focus_in_event), NULL);
+
CONVERT_TO_UTF8_FREE(text);
CONVERT_TO_UTF8_FREE(tooltip);