Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [albireo-dev] 1.5 Linux initial display problem

Gordon Hirsch wrote:
> Very consistently, on Linux under 1.5, in certain views (e.g. 
> EmbeddedJTable), the SwingControl is not displayed at all for me on 
> initial creation. As soon as any sort of user-initiated resize is done, 
> the SwingControl will appear.

Sometimes I reproduce it, sometimes I don't.

The Events fired by the SwingControl at initial creation are the same
in the case of bad display and in the case of correct display under JDK 1.6:

Event {type=11 EmbeddedJTableView$1 {} [frame=frame2] time=854596911 data=null x=0 y=0 width=0 height=0 detail=0}
Event {type=26 EmbeddedJTableView$1 {} [frame=frame2] time=854596911 data=null x=0 y=0 width=0 height=0 detail=0}
Event {type=27 EmbeddedJTableView$1 {} [frame=frame2] time=854602349 data=null x=0 y=0 width=0 height=0 detail=0}

type = 11 is SWT.Resize.

I don't know where it comes from, but your workaround seems to be really
needed. Applying this to fix up my last commit:

Bruno


Index: src/org/eclipse/albireo/core/SwingControl.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/core/SwingControl.java,v
retrieving revision 1.43
diff -c -3 -r1.43 SwingControl.java
*** src/org/eclipse/albireo/core/SwingControl.java	26 Feb 2008 19:56:27 -0000	1.43
--- src/org/eclipse/albireo/core/SwingControl.java	26 Feb 2008 21:13:12 -0000
***************
*** 622,628 ****
          checkPopulated();
          if (verboseSizeLayout)
              System.err.println("SWT thread: setBounds called: "+width+" x "+height);
!         if (!AUTOMATIC_SET_AWT_SIZE) {
              // Pass on the desired size to the embedded component, but only if it could 
              // be reasonably calculated (i.e. we have cached preferred sizes) and if
              // computeSize took it into account.
--- 622,633 ----
          checkPopulated();
          if (verboseSizeLayout)
              System.err.println("SWT thread: setBounds called: "+width+" x "+height);
!         // If the size of the frame automatically tracks the size on the SWT side,
!         // we don't need to do it explicitly.
!         // But it's nevertheless needed for the initial display sometimes, see below.
!         // TODO: research the initial content display problem further
!         if (!AUTOMATIC_SET_AWT_SIZE
!             || (Platform.isGtk() && Platform.JAVA_VERSION < Platform.javaVersion(1, 6, 0))) {
              // Pass on the desired size to the embedded component, but only if it could 
              // be reasonably calculated (i.e. we have cached preferred sizes) and if
              // computeSize took it into account.
***************
*** 636,643 ****
              // values then! It is better than to use them.
              //
              // Do not optimize with the cachedSizesInitialized flag on GTK/Java5 or 
!             // win32/SWT3.3 since this will prevent the initial contents of the control
!             // from being displayed. 
              // TODO: research the initial content display problem further
              synchronized (this) {
                  if ((cachedSizesInitialized >= 2) || 
--- 641,648 ----
              // values then! It is better than to use them.
              //
              // Do not optimize with the cachedSizesInitialized flag on GTK/Java5 or 
!             // win32/SWT3.3 since this may prevent the initial contents of the control
!             // from being displayed. Testcase: EmbeddedJTableView.
              // TODO: research the initial content display problem further
              synchronized (this) {
                  if ((cachedSizesInitialized >= 2) || 


Back to the top