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

Bug 83883

Summary: [Dialogs] Layout problems with WXGA resolution
Product: [Eclipse Project] Platform Reporter: Benjamin Pasero <bpasero>
Component: UIAssignee: Billy Biggs <billy.biggs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P2 CC: billy.biggs, Tod_Creasey
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Dialog taking entire screen-size as width none

Description Benjamin Pasero CLA 2005-01-27 17:15:06 EST
Hi,

a user working in WXGA resolution just pointed me to a problem with Dialogs
taking the entire screen-width as size. See the attached image on how it looks like.

I am using an older version of JFace (must be 3.0 M6), but the user told me that
he got the same problems using Eclipse.

I am working with DLUs and calling convertHorizontalDLUsToPixels() to calculate
the width of the Dialogs.

Is this a known issue?

Ben
Comment 1 Benjamin Pasero CLA 2005-01-27 17:16:36 EST
Created attachment 17536 [details]
Dialog taking entire screen-size as width
Comment 2 Billy Biggs CLA 2005-01-27 17:21:41 EST
You should clarify what the user means by WXGA.  Google seems to indicate that
WXGA is widescreen and 16:9, with a resolution of 1366x768.  Is that correct?

Also, the screenshot you show looks like it is from a MacOS machine.  Which
platform was this reported on?
Comment 3 Benjamin Pasero CLA 2005-01-27 17:49:44 EST
I am going to ask these questions to the user and post his answer then.

Ben
Comment 4 Benjamin Pasero CLA 2005-01-28 06:02:50 EST
Here is the answer from the user:

"What I mean by WXGA resolution is the resolution of most of recent laptops with
a ration of 16:10.
My own resolution is 1280x800 and I think it is the source of the bug cause I
didn't notice it on other computers with classical 4:3 resolution ratio.

Sorry I forgot for the platform. It's not a MacOSX system, I just customized my
Windows XP with WinOSX and applied a theme."

Ben
Comment 5 Billy Biggs CLA 2005-01-28 10:01:23 EST
I am marking this as a duplicate of bug 81055.  Something with this MacOS-style
theme is confusing our dialog unit code.  I do not think this has anything to do
with the screeen resolution.

Please re-open if you can reproduce this without using this theme.  As well, it
would be nice to know if you can tell us more about the theme that's being used
in bug 81055 so we could try to reproduce the problem.

*** This bug has been marked as a duplicate of 81055 ***
Comment 6 Benjamin Pasero CLA 2005-01-28 11:38:43 EST
As an answer on the question if this issue is Theme-dependant 
from a user having this problem:

"As I thought and as you'll be able to see it on the picture,
I get exactly the same issue when using no theme at all. But
it doesn't surprise me as I have tested it on several
workstations with different resolutions, OS and themes and
the problem only occurs on unusual ratio resolutions."

Ben
Comment 7 Billy Biggs CLA 2005-01-28 11:44:23 EST
Well, that's unfortunate, I really thought we were on to something.
Comment 8 Billy Biggs CLA 2005-01-28 11:47:17 EST
Here is the code for convertHorizontalDLUsToPixels().  All dialog units are
based on the font metrics.  I wonder if maybe there is something weird about the
DPI on these systems that affects the font metrics?  If possible it would be
useful to get these users to run a small SWT app that just prints out the font
metrics for a default font.

    public static int convertHorizontalDLUsToPixels(FontMetrics fontMetrics,
            int dlus) {
        // round to the nearest pixel
        return (fontMetrics.getAverageCharWidth() * dlus
                + HORIZONTAL_DIALOG_UNIT_PER_CHAR / 2)
                / HORIZONTAL_DIALOG_UNIT_PER_CHAR;
    }
Comment 9 Benjamin Pasero CLA 2005-01-29 12:48:00 EST
Ok, seems to be Theme Manager related:

"Ok ! I doudble checked on another computer with almost the
same configuration but without any customized theme manager
and it seems that the problem doesn't occur (see picture). I
don't understand because I don't have any problem with any
other GUI library on my system so it must be an
incompatibility issue between SWT and the theme manager I
use. "

Ben

*** This bug has been marked as a duplicate of 81055 ***