[gtk+] Update the context direction when emitting ::direction-changed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Update the context direction when emitting ::direction-changed
- Date: Tue, 8 Feb 2011 01:38:04 +0000 (UTC)
commit 3a50b460c6c64377d7402248e55b192d5c27ae2a
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 7 20:37:09 2011 -0500
Update the context direction when emitting ::direction-changed
This makes the flipping example in testgtk work as expected again.
https://bugzilla.gnome.org/show_bug.cgi?id=632775
gtk/gtkwidget.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b2f14db..3ac3050 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -10437,10 +10437,14 @@ gtk_widget_pop_composite_child (void)
static void
gtk_widget_emit_direction_changed (GtkWidget *widget,
- GtkTextDirection old_dir)
+ GtkTextDirection old_dir)
{
gtk_widget_update_pango_context (widget);
+ if (widget->priv->context)
+ gtk_style_context_set_direction (widget->priv->context,
+ gtk_widget_get_direction (widget));
+
g_signal_emit (widget, widget_signals[DIRECTION_CHANGED], 0, old_dir);
}
@@ -10464,7 +10468,7 @@ gtk_widget_emit_direction_changed (GtkWidget *widget,
**/
void
gtk_widget_set_direction (GtkWidget *widget,
- GtkTextDirection dir)
+ GtkTextDirection dir)
{
GtkTextDirection old_dir;
@@ -10476,13 +10480,7 @@ gtk_widget_set_direction (GtkWidget *widget,
widget->priv->direction = dir;
if (old_dir != gtk_widget_get_direction (widget))
- {
- if (widget->priv->context)
- gtk_style_context_set_direction (widget->priv->context,
- gtk_widget_get_direction (widget));
-
- gtk_widget_emit_direction_changed (widget, old_dir);
- }
+ gtk_widget_emit_direction_changed (widget, old_dir);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]