! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Cropped desktop icon selected RTL text
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description Ariel Galula 2009-04-17 07:23:07 CEST
Created attachment 2295 
Example screenshot

When i select a desktop icon with a Hebrew text the first letters are cropped.
Comment 1 Jannis Pohlmann editbugs 2009-04-17 07:54:15 CEST
Reassigning to Brian as this is a bug in xfdesktop, not Thunar.
Comment 2 Ariel Galula 2009-07-27 10:10:54 CEST
Reproducible: Always

Steps to Reproduce:
1. Select an desktop icon with long RTL (like Hebrew) name.

Actual Results:  
The text in right-align too much and the right side of the text is cropped. 

Expected Results:  
The whole text is shown.

Ubuntu Jaunty Jackalope
Comment 3 Ariel Galula 2009-07-27 10:41:31 CEST
Created attachment 2465 
RTL text stay around even after unselected
Comment 4 Khazar 2014-12-20 10:05:58 CET
Are there news in concern to this matter?

P.S. Ariel, would you like to assist in translating Xfce into Hebrew (as a translator or reviewer)?
Comment 5 Khazar 2015-01-24 04:35:08 CET
I guess the easiest solution would be to force LTR direction on icons with gtk_widget_set_direction. See http://git.gnome.org/browse/ekiga/commit/?id=76c9b23
Comment 6 Matias De lellis 2015-02-14 02:50:36 CET
Created attachment 5935 
Ugly patch to fix xfdesktop bug #5239 and proposal center text.

A small fix for this bug.. But is a ugly patch. We must fix other things really.

A question? Is acceptable center the text in RTL languages? In any case I ask you please try commenting the line:  
> //pango_layout_set_alignment(playout, PANGO_ALIGN_CENTER);
Comment 7 Matias De lellis 2015-02-14 03:00:14 CET
Created attachment 5936 
Before and after the new patch. (With center activated.)

Screenshot with the comparison. In this case, is with the centering of text activated, but also should work well without it. =)
Comment 8 Eric Koegel editbugs 2015-02-14 06:45:54 CET
As long as people who use RTL languages are ok with the change then I'd be happy
with a cleaned up version of the patch.

For what it's worth, when we port to GTK3 I'd like to remove the custom
text rendering and use a GtkLabel. This should make the code simpler and
make accessability easier to do. It hasn't be changed yet because it breaks
all the themes.
Comment 9 Khazar 2015-02-14 07:02:10 CET
It looks good.

Ali Abdallah, would you like to voice your thoughts on this matter?
Do you give me a permission to CC to you in bugs related to RTL issue, from now on?
Comment 10 Matias De lellis 2015-02-14 13:24:17 CET
Created attachment 5937 
Fix calculation of shadows that are offset in RTL text.

Just fix this bug.

But please note that is only corrected when drawing the shadows. There is a problem in the calculation, which comes previous code and still not discover.

About to center the text, if it is not appropriate with RTL (Please confirm it), maybe could add a private option in xfconf.
Comment 11 Khazar 2015-02-14 14:27:22 CET
> About to center the text, if it is not appropriate with RTL (Please confirm it), maybe could add a private option in xfconf.

It is fine. There is that proprietary OS that does so since the late 80's, and some other *NIX desktops.
Comment 12 Matias De lellis 2015-02-14 15:11:00 CET
Created attachment 5938 
Add a xfconf settings to center the text on xfdesktop icons.

> > About to center the text, if it is not appropriate with RTL (Please confirm
> > it), maybe could add a private option in xfconf.
>
> It is fine. There is that proprietary OS that does so since the late 80's,
> and some other *NIX desktops.

Ok.. Thanks!!! =)

Well, about the new patch this add a new xfconf settings to center the text that
is enabled by default, but always optional. ;)

Note that the patch requires the previous, to fix the shadows. ;)
Comment 13 Matias De lellis 2015-02-14 15:29:33 CET
Created attachment 5939 
Add xfconf setting to center the text on xfdesktop icons.

Hi,
Fix than in the previous patch not init the center-text property when start the desktop.
Comment 14 Eric Koegel editbugs 2015-02-14 19:35:03 CET
Awesome! Pushed both to master:
commit 1c5b2b28fa861df3997e7d48ddd7ae8b3cad3a43
Author: Matias De lellis <mati86dl@gmail.com>
Date:   Sat Feb 14 11:26:26 2015 -0300

    Add a xfconf settings to center the text on xfdesktop icons.
    
    This is enabled by default, but done optionally to fix RTL languages.
    
    Signed-off-by: Eric Koegel <eric.koegel@gmail.com>

http://git.xfce.org/xfce/xfdesktop/commit/?id=6630507a15e8e35cd14c4fcc81d887a85e667d50

commit 6630507a15e8e35cd14c4fcc81d887a85e667d50
Author: Matias De lellis <mati86dl@gmail.com>
Date:   Sat Feb 14 09:10:44 2015 -0300

    Fix calculation of shadows that are offset in RTL text (Bug #5239)
    
    Signed-off-by: Eric Koegel <eric.koegel@gmail.com>

http://git.xfce.org/xfce/xfdesktop/commit/?id=1c5b2b28fa861df3997e7d48ddd7ae8b3cad3a43
Comment 15 Matias De lellis 2015-02-14 20:03:35 CET
Created attachment 5940 
Consider shadow offsets and blur extents when calculating the text box.

Hi Again,
Now try to fix a related bug, which is old but was potentiated from that implements the blur in the shade!.

Sorry I not open another bug, but I found thanks to these changes!. ;)
Comment 16 Matias De lellis 2015-02-14 21:53:32 CET
D'Oh!.

Sie commit it please change before in patch:

> +    text_area->height = prect.height + 2 * (SHADOW_EXTENTS - SHADOW_Y_OFFSET);
to
> +    text_area->height = prect.height + 2 * (SHADOW_EXTENTS + SHADOW_Y_OFFSET);

And the macro SHADOW_Y(X)_OFFSET should consider the positive of selected/unselected offsets.
Comment 17 Eric Koegel editbugs 2015-02-16 07:01:46 CET
Pushed to master:
commit 010aea99483ae480a3328fa66e5c5768feda30d5
Author: Matias De lellis <mati86dl@gmail.com>
Date:   Mon Feb 16 08:49:05 2015 +0300

    Consider shadow offsets and blur extents when calculating the text box
    
    This fixes some gliches when you drag and drop icons on desktop, cutting
    the shadows and showing a party in original position and another in the
    new position.
    
    Also calculates the extent necessary to blur a unique time instead of once
    for each icon.
http://git.xfce.org/xfce/xfdesktop/commit/?id=010aea99483ae480a3328fa66e5c5768feda30d5

Hopefully I got it right.

Bug #5239

Reported by:
Ariel Galula
Reported on: 2009-04-17
Last modified on: 2015-02-16

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
6 users

Version

Attachments

Additional information