=== modified file 'src/gtkutil.c' --- src/gtkutil.c 2011-08-29 20:57:42 +0000 +++ src/gtkutil.c 2011-09-06 15:47:54 +0000 @@ -3855,7 +3855,7 @@ static gboolean xg_tool_bar_menu_proxy (GtkToolItem *toolitem, gpointer user_data) { - GtkButton *wbutton = GTK_BUTTON (XG_BIN_CHILD (XG_BIN_CHILD (toolitem))); + GtkButton *wbutton = GTK_BUTTON (XG_BIN_CHILD (toolitem)); GtkWidget *vb = XG_BIN_CHILD (wbutton); GtkWidget *c1; GtkLabel *wlbl = GTK_LABEL (xg_get_tool_bar_widgets (vb, &c1)); @@ -4165,6 +4165,9 @@ xg_create_tool_bar (FRAME_PTR f) { struct x_output *x = f->output_data.x; +#ifdef HAVE_GTK3 + GtkStyleContext *gsty; +#endif x->toolbar_widget = gtk_toolbar_new (); x->toolbar_detached = 0; @@ -4173,6 +4176,10 @@ gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); +#ifdef HAVE_GTK3 + gsty = gtk_widget_get_style_context (x->toolbar_widget); + gtk_style_context_add_class (gsty, "primary-toolbar"); +#endif } @@ -4219,7 +4226,6 @@ GtkToolItem *ti = gtk_tool_item_new (); GtkWidget *vb = horiz ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0); GtkWidget *wb = gtk_button_new (); - GtkWidget *weventbox = gtk_event_box_new (); if (wimage && !text_image) gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0); @@ -4231,8 +4237,7 @@ gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE); gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE); gtk_container_add (GTK_CONTAINER (wb), vb); - gtk_container_add (GTK_CONTAINER (weventbox), wb); - gtk_container_add (GTK_CONTAINER (ti), weventbox); + gtk_container_add (GTK_CONTAINER (ti), wb); if (wimage) { @@ -4247,7 +4252,6 @@ G_CALLBACK (xg_tool_bar_callback), gi); - g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f); #ifndef HAVE_GTK3 /* Catch expose events to overcome an annoying redraw bug, see @@ -4273,11 +4277,11 @@ "leave", so we can have only one callback. The event will tell us what kind of event it is. */ /* The EMACS_INT cast avoids a warning. */ - g_signal_connect (G_OBJECT (weventbox), + g_signal_connect (G_OBJECT (wb), "enter-notify-event", G_CALLBACK (xg_tool_bar_help_callback), gi); - g_signal_connect (G_OBJECT (weventbox), + g_signal_connect (G_OBJECT (wb), "leave-notify-event", G_CALLBACK (xg_tool_bar_help_callback), gi); @@ -4480,7 +4484,7 @@ ti = NULL; } - if (ti) wbutton = XG_BIN_CHILD (XG_BIN_CHILD (ti)); + if (ti) wbutton = XG_BIN_CHILD (ti); /* Ignore invalid image specifications. */ image = PROP (TOOL_BAR_ITEM_IMAGES);