+static void
+gtk_path_bar_realize (GtkWidget *widget)
+{
+ GtkPathBar *path_bar;
+ GtkAllocation allocation;
+ GdkWindow *window;
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ gtk_widget_set_realized (widget, TRUE);
+
+ path_bar = GTK_PATH_BAR (widget);
+ window = gtk_widget_get_parent_window (widget);
+ gtk_widget_set_window (widget, window);
+ g_object_ref (window);
+
+ gtk_widget_get_allocation (widget, &allocation);
+
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
+ attributes.wclass = GDK_INPUT_ONLY;
+ attributes.event_mask = gtk_widget_get_events (widget);
+ attributes.event_mask |= GDK_SCROLL_MASK;
+ attributes_mask = GDK_WA_X | GDK_WA_Y;
+
+ path_bar->event_window = gdk_window_new (gtk_widget_get_parent_window (widget),
+ &attributes, attributes_mask);
+ gtk_widget_register_window (widget, path_bar->event_window);
+}
+
+static void
+gtk_path_bar_unrealize (GtkWidget *widget)
+{
+ GtkPathBar *path_bar;
+
+ path_bar = GTK_PATH_BAR (widget);
+
+ gtk_widget_unregister_window (widget, path_bar->event_window);
+ gdk_window_destroy (path_bar->event_window);
+ path_bar->event_window = NULL;
+
+ GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->unrealize (widget);
+}
+
+static void
+child_ordering_changed (GtkPathBar *path_bar)
+{
+ GList *l;
+
+ if (path_bar->up_slider_button)
+ _gtk_widget_invalidate_style_context (path_bar->up_slider_button,
+ GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
+ if (path_bar->down_slider_button)
+ _gtk_widget_invalidate_style_context (path_bar->down_slider_button,
+ GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
+
+ for (l = path_bar->button_list; l; l = l->next)
+ {
+ ButtonData *data = l->data;
+
+ _gtk_widget_invalidate_style_context (data->button,
+ GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
+ }
+}
+