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

Bug 228695

Summary: Measure event always comes before an Erase/Paint event on Mac and Windows, but not on GTK
Product: [Eclipse Project] Platform Reporter: Boris Bokowski <bokowski>
Component: SWTAssignee: Bogdan Gheorghe <gheorghe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniele.dimauro, daniel_megert, dwain.bethel, gattacus, gheorghe, grant_gayed, markus.kell.r, martinae, Mike_Wilson, pinnamur, remy.suen, Silenio_Quarti, snorthov, tom.schindl
Version: 3.4   
Target Milestone: 3.6 M3   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Bug Depends on:    
Bug Blocks: 228397, 292198    
Attachments:
Description Flags
snippet none

Description Boris Bokowski CLA 2008-04-24 11:36:46 EDT
Run the attached snippet on GTK and observe how the items don't look right after moving over them with the mouse, or after scrolling.

They are supposed to look like:
000
111
222
333
etc.

The snippet works on Windows and the Mac. It caches a TextLayout object in MeasureItem and uses it in PaintItem.
Comment 1 Boris Bokowski CLA 2008-04-24 11:37:14 EDT
Created attachment 97479 [details]
snippet
Comment 2 Steve Northover CLA 2008-04-24 11:42:12 EDT
Might not get to this until after M7.
Comment 3 Mike Wilson CLA 2008-09-11 15:33:29 EDT
Reminder that this is still a pain. Can we put it on the list for 3.5?
Comment 4 Boris Bokowski CLA 2008-09-17 13:21:38 EDT
Do you plan to address this in 3.5?
Comment 5 Steve Northover CLA 2008-10-01 18:21:40 EDT
Boris, measure events can come with no corresponding erase or paint (for example, when packing a column).  Is this a problem?

I think that the GTK behavior indicates a bug but I can't get to it right now.  Please find me and force me to look at it.
Comment 6 Dani Megert CLA 2009-08-13 06:59:10 EDT
Can this be looked at for 3.6?
Comment 7 Silenio Quarti CLA 2009-08-17 17:43:20 EDT
Bogdan, let's investigate this one.
Comment 8 Grant Gayed CLA 2009-09-15 09:53:16 EDT
this could be the cause of bug 288565
Comment 9 Bogdan Gheorghe CLA 2009-09-15 14:52:14 EDT
It most probably is the cause of 288565. I have a potential fix for this in a workspace - it'll be the first thing I do after M2 is out.
Comment 10 Bogdan Gheorghe CLA 2009-09-24 16:56:34 EDT
Fixed in HEAD > 20090924
Comment 11 Bogdan Gheorghe CLA 2009-09-24 17:04:35 EDT
*** Bug 288565 has been marked as a duplicate of this bug. ***
Comment 12 dwain Mising name CLA 2009-11-12 17:02:14 EST
It says that this bug is resolved in head 20090924 which I am guessing is the build ID.  I just downloaded eclipse from eclipse.org today and my build ID is 20090920-1017 which still has that problem.  How can I get that build with the fix in it?
Comment 13 Remy Suen CLA 2009-11-12 17:08:30 EST
(In reply to comment #12)
> It says that this bug is resolved in head 20090924 which I am guessing is the
> build ID.  I just downloaded eclipse from eclipse.org today and my build ID is
> 20090920-1017 which still has that problem.  How can I get that build with the
> fix in it?

What download did you get? What is its name? The fix was for 3.6.x, not 3.5.x.
Comment 14 Bogdan Gheorghe CLA 2009-11-12 17:24:30 EST
20090924 is the date when the fix got committed to HEAD *not* the build id. You just need to pick any 3.6 build that was built after 20090924 and it will contain the fix.
Comment 15 Markus Keller CLA 2010-06-28 06:54:52 EDT
*** Bug 305843 has been marked as a duplicate of this bug. ***
Comment 16 Missing name CLA 2011-02-01 09:51:13 EST
In JFace 3.6.1 in StyledCellLabelProvider this bug is mentioned with a temporary change:
		/* remove-begin if bug 228695 fixed */
		itemOfLastMeasure = event.item;
		elementOfLastMeasure = event.item.getData();
		/* remove-end if bug 228695 fixed */
and more.This should be removed if feasible because elementOfLastMeasure is a reference to a domain-object which cannot be accessed/removed. Due to the strong reference a lot of memory is leaked in my case.
Comment 17 Markus Keller CLA 2016-01-25 09:28:14 EST
(In reply to Missing name from comment #16)
The workarounds were removed for 3.7, see bug 292198 comment 3.