[Xfce4-commits] r29972 - in xfwm4/trunk: . src

Olivier Fourdan olivier at xfce.org
Fri May 22 14:52:56 CEST 2009


Author: olivier
Date: 2009-05-22 12:52:55 +0000 (Fri, 22 May 2009)
New Revision: 29972

Modified:
   xfwm4/trunk/ChangeLog
   xfwm4/trunk/NEWS
   xfwm4/trunk/src/frame.c
   xfwm4/trunk/src/tabwin.c
Log:
	* frame.c, tabwin.c: Fix mixed RTL/LTR text not rendering properly 
	  in title and tabwin

Modified: xfwm4/trunk/ChangeLog
===================================================================
--- xfwm4/trunk/ChangeLog	2009-05-22 11:50:43 UTC (rev 29971)
+++ xfwm4/trunk/ChangeLog	2009-05-22 12:52:55 UTC (rev 29972)
@@ -1,3 +1,7 @@
+2009-05-22	olivier
+	* frame.c, tabwin.c: Fix mixed RTL/LTR text not rendering properly 
+	  in title and tabwin
+
 2009-04-12	olivier
 
 	* configure.ac.in, themes/Makefile.am: Update versions

Modified: xfwm4/trunk/NEWS
===================================================================
--- xfwm4/trunk/NEWS	2009-05-22 11:50:43 UTC (rev 29971)
+++ xfwm4/trunk/NEWS	2009-05-22 12:52:55 UTC (rev 29972)
@@ -1,3 +1,8 @@
+4.6.2
+=====
+
+- Fix mixed RTL/LTR text not rendering properly in title and tabwin
+
 4.6.1
 =====
 

Modified: xfwm4/trunk/src/frame.c
===================================================================
--- xfwm4/trunk/src/frame.c	2009-05-22 11:50:43 UTC (rev 29971)
+++ xfwm4/trunk/src/frame.c	2009-05-22 12:52:55 UTC (rev 29972)
@@ -313,9 +313,6 @@
         return;
     }
 
-    layout = gtk_widget_create_pango_layout (myScreenGetGtkWidget (screen_info), c->name);
-    pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
-
     if (left < frameTopLeftWidth (c, state))
     {
         left = frameTopLeftWidth (c, state);
@@ -344,6 +341,10 @@
         voffset = screen_info->params->title_vertical_offset_inactive;
     }
 
+    layout = gtk_widget_create_pango_layout (myScreenGetGtkWidget (screen_info), c->name);
+    pango_layout_set_auto_dir (layout, FALSE);
+    pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
+
     title_height = screen_info->font_height;
     if (!title_height)
     {

Modified: xfwm4/trunk/src/tabwin.c
===================================================================
--- xfwm4/trunk/src/tabwin.c	2009-05-22 11:50:43 UTC (rev 29971)
+++ xfwm4/trunk/src/tabwin.c	2009-05-22 12:52:55 UTC (rev 29972)
@@ -107,9 +107,9 @@
 {
     gchar *markup;
     gchar *message;
+    PangoLayout *layout;
 
     message = pretty_string (class);
-    gtk_label_set_use_markup (GTK_LABEL (t->class), TRUE);
     markup = g_strconcat ("<span size=\"larger\" weight=\"bold\">", message, "</span>", NULL);
     g_free (message);
 
@@ -124,7 +124,13 @@
     {
         message = g_strdup_printf ("%s", label);
     }
+
     gtk_label_set_text (GTK_LABEL (t->label), message);
+    /* Need to update the layout after setting the text */
+    layout = gtk_label_get_layout (GTK_LABEL(t->label));
+    pango_layout_set_auto_dir (layout, FALSE);
+    /* the layout belong to the gtk_label and must not be freed */
+
     g_free (message);
 }
 
@@ -287,7 +293,7 @@
     gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
     gtk_container_add (GTK_CONTAINER (colorbox2), vbox);
 
-    tabwin->class = gtk_label_new (NULL);
+    tabwin->class = gtk_label_new ("");
     gtk_label_set_use_markup (GTK_LABEL (tabwin->class), TRUE);
     gtk_label_set_justify (GTK_LABEL (tabwin->class), GTK_JUSTIFY_CENTER);
     gtk_box_pack_start (GTK_BOX (vbox), tabwin->class, TRUE, TRUE, 0);
@@ -300,6 +306,7 @@
     tabwin->label = gtk_label_new ("");
     gtk_label_set_use_markup (GTK_LABEL (tabwin->label), FALSE);
     gtk_label_set_justify (GTK_LABEL (tabwin->label), GTK_JUSTIFY_CENTER);
+    gtk_label_set_use_markup (GTK_LABEL (tabwin->class), TRUE);
     gtk_box_pack_start (GTK_BOX (vbox), tabwin->label, TRUE, TRUE, 0);
     gtk_widget_set_size_request (GTK_WIDGET (tabwin->label), 240, -1);
 




More information about the Xfce4-commits mailing list