+static void
+gtk_combo_box_invalidate_order_foreach (GtkWidget *widget)
+{
+ _gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
+}
+
+static void
+gtk_combo_box_invalidate_order (GtkComboBox *combo_box)
+{
+ gtk_container_forall (GTK_CONTAINER (combo_box),
+ (GtkCallback) gtk_combo_box_invalidate_order_foreach,
+ NULL);
+}
+
+static void
+gtk_combo_box_direction_changed (GtkWidget *widget,
+ GtkTextDirection previous_direction)
+{
+ gtk_combo_box_invalidate_order (GTK_COMBO_BOX (widget));
+}
+
+static GtkWidgetPath *
+gtk_combo_box_get_path_for_child (GtkContainer *container,
+ GtkWidget *child)
+{
+ GtkComboBoxPrivate *priv = GTK_COMBO_BOX (container)->priv;
+ GtkWidgetPath *path;
+ GtkWidget *widget;
+ gboolean found = FALSE;
+ GList *visible_children, *l;
+ GtkWidgetPath *sibling_path;
+ int pos;
+
+ path = _gtk_widget_create_path (GTK_WIDGET (container));
+
+ if (gtk_widget_get_visible (child))
+ {
+ visible_children = NULL;
+
+ if (priv->button && gtk_widget_get_visible (priv->button))
+ visible_children = g_list_prepend (visible_children, priv->button);
+
+ if (priv->cell_view_frame && gtk_widget_get_visible (priv->cell_view_frame))
+ visible_children = g_list_prepend (visible_children, priv->cell_view_frame);
+
+ widget = gtk_bin_get_child (GTK_BIN (container));
+ if (widget && gtk_widget_get_visible (widget))
+ visible_children = g_list_prepend (visible_children, widget);
+
+ if (gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
+ visible_children = g_list_reverse (visible_children);
+
+ pos = 0;
+
+ for (l = visible_children; l; l = l->next)
+ {
+ widget = l->data;
+
+ if (widget == child)
+ {
+ found = TRUE;
+ break;
+ }
+
+ pos++;
+ }
+ }
+
+ if (found)
+ {
+ sibling_path = gtk_widget_path_new ();
+
+ for (l = visible_children; l; l = l->next)
+ gtk_widget_path_append_for_widget (sibling_path, l->data);
+
+ gtk_widget_path_append_with_siblings (path, sibling_path, pos);
+
+ g_list_free (visible_children);
+ gtk_widget_path_unref (sibling_path);
+ }
+ else
+ {
+ gtk_widget_path_append_for_widget (path, child);
+ }
+
+ return path;
+}
+