Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4146541

Frame contents not shown when display exported to OS/2 PMX

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • client-libs
    • generic
    • generic



      Name: mf23781 Date: 06/08/98


      The testcase given below displays a frame containing a label. The frame
      has a menubar and a warning window. To ensure you get the warning window
      run the testcase using this command:
       
        java -Dawt.appletWarning=IAmAWarningWIndow FrameTest
       
      With the display exported to an AIX box the frame is displayed properly.
      With the display exported to OS/2 with PMX and running JDK116 on Solaris,
      AIX or OS/390, the body of the frame has the default background colour,
      not yellow as specified in the testcase, and the label within it is not
      visible. The menubar and warning window are visible.
       
      The essential problem is that a difference in behaviour between the X
      Server on AIX and the PMX server on OS/2 has been exposed by a change in
      design between 1.1.4 and 1.1.6.
       
      The change in design concerns how a frame peer is implemented in
      awt_Frame.c. In 1.1.4 the peer's insets are set in the
      ...MFramePeer_create() function. They are subsequently adjusted
      whenever a menubar, warning window or so on is added or removed.
       
      In 1.1.6 the insets are simply guessed in the
      ...MFramePeer_create() function and a flag called fixInsets is set.
      A ReparentNotify event for the peer (or, more precisely, for its shell
      widget) is then expected. When the event arrives, the insets are set
      exactly, the fixInsets flag is cleared and the reshape() function is
      called. One behaviour of reshape() is to configure the inner/parent
      canvas contained within the shell widget.
       
      The fixInsets flag is used by the event handler for the inner/parent
      canvas, innerCanvasEH(). Provided insets have been corrected (ie
      fixInsets is cleared) innerCanvasEH() configures the outer/child canvas
      within the shell widget. If insets have not been corrected
      innerCanvasEH() returns immediately without configuring the outer/child
      canvas.
       
      With the X Server on AIX, the server sends a ReparentNotify event for
      the shell widget as expected so insets are corrected and both the
      inner/parent and outer/child canvases are configured.
       
      With PMX on OS/2 a ReparentNotify event is never sent. The insets are
      not corrected, fixInsets is not cleared and reshape() is not called.
      Because reshape() is not called the inner/parent canvas is not
      configured. And because fixInsets is not cleared the outer/child canvas
      is not configured and the observed behaviour results.
       
      It is not immediately clear how this should be fixed as it is primarily
      an issue with the new design. The previous design did not rely on the
      ReparentNotify event and so was not sensitive to the difference in
      behaviour between X Server and PMX. I have shown that the problem goes
      away when a ReparentNotify is explicitly sent by calling
      XReparentWindow() on the shell widget's window in the
      ...MFramePeer_pShow() function. This might be a solution if there is a
      way to invoke it conditionally on PMX being used (although sending an
      extra ReparentNotify when X Server is being used does not seem to break
      anything).

      This is not only restricted to IBM platforms, but we will work on a fix nevertheless.
       
      /******************/
      /* FrameTest.java */
      /******************/
       
      import java.awt.*;
       
      public class FrameTest
      {
        public static void main(String[] args)
        {
          // Force java.lang.Window() to include a warning window in the frame
          System.setSecurityManager(new java.rmi.RMISecurityManager()
            { public boolean checkTopLevelWindow(Object window) { return false; } });
       
          new FrameTest();
        }
       
        public FrameTest()
        {
          Frame f = new Frame("I am a frame with a yellow background");
       
          MenuBar mb = new MenuBar();
          Menu fileMenu = new Menu("I am a menubar");
          mb.add(fileMenu);
          f.setMenuBar(mb);
       
          Label l = new Label("I am a label with a red background");
          l.setBackground(Color.red);
          f.add(l);
       
          f.setSize(400, 150);
          f.setBackground(Color.yellow);
          f.show();
        }
      }

      ======================================================================

            dmendenhsunw David Mendenhall (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: