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

Bug 465309

Summary: [GTK3] No icon showing in open type dialog
Product: [Eclipse Project] Platform Reporter: Pascal Rapicault <pascal>
Component: SWTAssignee: Sravan Kumar Lakkimsetti <sravankumarl>
Status: VERIFIED FIXED QA Contact: Arun Thondapu <arunkumar.thondapu>
Severity: major    
Priority: P1 CC: arunkumar.thondapu, daniel_megert, malaperle, peter, snjezana.peco, sravankumarl
Version: 4.5Flags: arunkumar.thondapu: review+
Target Milestone: 4.5 RC1   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/47806
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6930fdd35d9cdffd6d05c778fb4b82a2018d7fcb
Whiteboard:
Bug Depends on:    
Bug Blocks: 441566    
Attachments:
Description Flags
screenshot of the pb
none
Screenshot of the problem using gtk_tree_view_get_visible_rectangle
none
Using gtk_tree_view_get_visible_rectangle without vertical scroll bar none

Description Pascal Rapicault CLA 2015-04-23 10:33:11 EDT
Created attachment 252682 [details]
screenshot of the pb

I20150422
The icons are not being shown in the open type dialog
Comment 1 Pascal Rapicault CLA 2015-04-23 10:33:32 EDT
I'm running ubuntu 14.04 LTS
Comment 2 Marc-André Laperle CLA 2015-05-05 18:16:04 EDT
I am seeing this on Ubuntu 14.04 as well. But it works correctly on Ubuntu 15.04, which has GTK 3.14.12 instead of 3.10.8. It works correctly with GTK2 (SWT_GTK3=0).
Comment 3 Arun Thondapu CLA 2015-05-06 02:39:31 EDT
Not reproducible on Ubuntu 12.04 (GTK 3.4.2) and RHEL 7.1 (GTK 3.8.8) too, probably something specific to GTK 3.10...

Sravan, please investigate a fix for RC1.
Comment 4 Arun Thondapu CLA 2015-05-06 03:01:45 EDT
Could be related to bug 435773. Open Resource also has the same problem on Ubuntu 14.04.
Comment 5 Sravan Kumar Lakkimsetti CLA 2015-05-12 04:40:03 EDT
CC ing snjeza.peco@gmail.com as it is related to bug 459117
Comment 6 Marc-André Laperle CLA 2015-05-12 10:17:14 EDT
Reverting fix for bug 459117 does "fix" this bug. I went a bit further and tried to apply the fix for bug 459117 only for GTK > 3.11.0 but this does bring back the problem described in bug 459117 for GTK 3.10.8. So it looks like there needs to be a better or different work around for bug 459117 that is compatible with GTK 3.10.8 without introducing this bug.
Comment 7 Snjezana Peco CLA 2015-05-12 14:54:10 EDT
I think this is a GTK3 bug fixed in GTK 3.14.9.
The fix/workaround for bug 459117 is limited to GTK >= 3.10 and < 3.14.9.
Comment 8 Marc-André Laperle CLA 2015-05-12 16:35:08 EDT
Here is the commit that "fixed it" in GTK:

commit 77c27772c5b28545acb89c66c5c5e4a0bc0b1224
Author: Benjamin Otte <otte@redhat.com>
Date:   Sat Jan 24 03:29:18 2015 +0100

    treeview: Don't create an overly large pixel cache
    
    GPUs generally have problems when you create a 35000px wide surface.
    Luckily X catches this and sends a BadAlloc. Which GTK immediately
    abort()s on.
    
    Testcase included.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1163579


From what I understand of this commit, one concern I have is that GTK is free to increase the pixel cache again and the work around won't work anymore. Perhaps there's a better way to calculate the rectangle/clipping? Maybe gtk_tree_view_get_visible_rect would be useful?
Comment 9 Sravan Kumar Lakkimsetti CLA 2015-05-13 04:27:06 EDT
(In reply to Marc-Andre Laperle from comment #8)
> Here is the commit that "fixed it" in GTK:
> 
> commit 77c27772c5b28545acb89c66c5c5e4a0bc0b1224
> Author: Benjamin Otte <otte@redhat.com>
> Date:   Sat Jan 24 03:29:18 2015 +0100
> 
>     treeview: Don't create an overly large pixel cache
>     
>     GPUs generally have problems when you create a 35000px wide surface.
>     Luckily X catches this and sends a BadAlloc. Which GTK immediately
>     abort()s on.
>     
>     Testcase included.
>     
>     https://bugzilla.redhat.com/show_bug.cgi?id=1163579
> 
> 
> From what I understand of this commit, one concern I have is that GTK is
> free to increase the pixel cache again and the work around won't work
> anymore. Perhaps there's a better way to calculate the rectangle/clipping?
> Maybe gtk_tree_view_get_visible_rect would be useful?

Thanks Marc-Andre. I did some testing with gtk_tree_view_get_vissible_rectangle. The behaviour is much better but it doesnot fix the problem completely. I am attaching the screen shots here
Comment 10 Sravan Kumar Lakkimsetti CLA 2015-05-13 04:28:14 EDT
Created attachment 253430 [details]
Screenshot of the problem using gtk_tree_view_get_visible_rectangle
Comment 11 Sravan Kumar Lakkimsetti CLA 2015-05-13 04:28:58 EDT
Created attachment 253431 [details]
Using gtk_tree_view_get_visible_rectangle without vertical scroll bar
Comment 12 Eclipse Genie CLA 2015-05-13 06:04:02 EDT
New Gerrit change created: https://git.eclipse.org/r/47806
Comment 13 Sravan Kumar Lakkimsetti CLA 2015-05-13 06:07:38 EDT
Can you please review this patch. I modified the clip rectangle to cover the image also.
Comment 15 Arun Thondapu CLA 2015-05-13 11:07:15 EDT
Looks good, verified on Ubuntu 14.04 with multiple Table/Tree related views and everything seems to work well now. Thanks Sravan! We should verify on Ubuntu 15.04 and/or Fedora 21 if possible, they should not be affected by this change in any way because of the version guard in the patch.
Comment 16 Marc-André Laperle CLA 2015-05-13 12:29:18 EDT
Thanks Sravan!
Comment 17 Sravan Kumar Lakkimsetti CLA 2015-05-14 08:04:46 EDT
Verified on I20150513-2000 on Linux 64 bit