Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 509455

Summary: [GTK3] The size of label with wrapping text is computed incorrectly
Product: [Eclipse Project] Platform Reporter: Mikhail Gaykovoy <black.pojo>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, ericwill, gautier.desaintmartinlacaze
Version: 4.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch for label
none
patch none

Description Mikhail Gaykovoy CLA 2016-12-19 10:26:06 EST
Created attachment 265944 [details]
patch for label

If Label has SWT.WRAP style, the method computeSizeInPixels(int, int, boolean) uses label's Pango layout to compute the size of text in pixels and uses this size as computed size of label. But when GTK3 is used, the origin of underlying Pango layout is shifted from the origin of label. This happens because there is padding setting for the label in the gtk3-theme. As result the text does not fit in computed size.
Comment 1 Mikhail Gaykovoy CLA 2016-12-20 00:19:14 EST
Created attachment 265960 [details]
patch
Comment 2 Alexander Kurtakov CLA 2016-12-20 06:04:02 EST
Would you please provide the patch via gerrit and some snippet that demoes the issue/can be used for verifying the fix?
Comment 3 Alexander Kurtakov CLA 2016-12-20 08:01:38 EST
(In reply to Alexander Kurtakov from comment #2)
> Would you please provide the patch via gerrit and some snippet that demoes
> the issue/can be used for verifying the fix?

I'm interested in which Gtk version and theme this happens with so it is easier to try it out as can't be reproduced on my Fedora 25/Gtk 3.22/ Adwaita combo.
Comment 4 Mikhail Gaykovoy CLA 2016-12-20 09:39:44 EST
(In reply to Alexander Kurtakov from comment #3)
> (In reply to Alexander Kurtakov from comment #2)
> > Would you please provide the patch via gerrit and some snippet that demoes
> > the issue/can be used for verifying the fix?
> 
> I'm interested in which Gtk version and theme this happens with so it is
> easier to try it out as can't be reproduced on my Fedora 25/Gtk 3.22/
> Adwaita combo.

We use Gtk 3.4.2 and Evolve theme (https://github.com/satya164/Evolve)
Comment 5 Eric Williams CLA 2018-06-15 15:40:20 EDT
Is this still an issue on GTK3.22?
Comment 6 Eric Williams CLA 2018-07-04 11:17:15 EDT
(In reply to Eric Williams from comment #5)
> Is this still an issue on GTK3.22?

No response in awhile and there have been some fixes to Label.computeSizeInPixels() lately, like bug 534768. Please reopen this ticket with a reproducer snippet if the issue occurs on 4.8 with GTK3.22.