Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 241062 - [consistency] Font#getFontData() not safe from non-ui thread on MacOS
Summary: [consistency] Font#getFontData() not safe from non-ui thread on MacOS
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 240076
  Show dependency tree
 
Reported: 2008-07-16 06:39 EDT by Benjamin Pasero CLA
Modified: 2008-09-03 12:41 EDT (History)
8 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
patch (2.73 KB, patch)
2008-09-03 12:26 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2008-07-16 06:39:03 EDT
This seems to have worked before in 3.3 and changed in 3.4. A call to Font#getFontData() from a non-ui thread results in a SWT exception. For one, the JavaDoc is not speced to throw this exception and second, it works fine on Windows and Linux. The call to Device#getDPI() from getFontData() calls checkDevice() and causes this issue.
Comment 1 Silenio Quarti CLA 2008-07-17 09:46:08 EDT
Kevin, this is happening because of the call to Device.getDPI() we introduced to fix the printing problem. We should remove that code since it is not doing anything (other parts of the code got removed for other reasons). Note that there are two calls to getDPI(), the other one is in init().

We have to find another way of getting the printer DPI when we try to fix that other problem again.
Comment 2 Benjamin Pasero CLA 2008-07-31 10:23:57 EDT
Will this be considered in 3.4.1?
Comment 3 Silenio Quarti CLA 2008-07-31 10:29:14 EDT
Yes
Comment 4 Benjamin Pasero CLA 2008-07-31 10:51:59 EDT
Great!
Comment 5 Steffen Pingel CLA 2008-08-05 17:40:00 EDT
We ran into this bug in Mylyn when font initialization was triggered from a lightweight decoration thread (bug 240076) and ended up moving initialization into an asyncExec call. It would be great if a fix made it into 3.4.1.
Comment 6 Silenio Quarti CLA 2008-08-06 10:31:19 EDT
Fixed in HEAD (>20080806)
Comment 7 Benjamin Pasero CLA 2008-08-22 06:54:50 EDT
Great Silenio, we tried a nightly of 3.4.1 and the fix does not seem to be included there. Did it not make into the maintenance stream yet?
Comment 8 Philipe Mulet CLA 2008-09-02 11:53:44 EDT
Silenio/Steve - is this really to be considered for 3.4.1 ? 
Remember it needs PMC approval to make it into 3.4.1rc2
Comment 9 Bryan Hunt CLA 2008-09-02 15:49:48 EDT
This defect makes using Rational Team Concert under 3.4 on OS X very painful.  Please push the fix into 3.4.1
Comment 10 Silenio Quarti CLA 2008-09-03 11:55:38 EDT
We missed this one because the wrong field was set (version instead of milestone). This we be put in tonight.
Comment 11 Silenio Quarti CLA 2008-09-03 12:01:42 EDT
Released in 3.4.1 stream.
Comment 12 Silenio Quarti CLA 2008-09-03 12:26:02 EDT
Created attachment 111594 [details]
patch

Here is the patch for 3.4.1. These are the changes proposed in comment#1, which remove the offending code. Screen resolution and printer resolution is always 72x72, so there is no real change.