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

Window.setSize moves window, sometimes off screen

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 1.4.0
    • client-libs
    • Fix Understood
    • x86
    • linux



      Name: bsC130419 Date: 08/24/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)


      Calling Window.setSize moves a Frame's window, sometimes off the
      screen.

      (I had a detailed bug report, but Netscape trashed it. I'll try to re-compose
      for as long as I can stand.)

      My environment is:
      - JDK 1.4.0 beta, for Linux
      - Linux distribution: Debian potato, pretty vanilla
      - X11 environment: xfree86 3.3.6, color depth 15 (configuration attached
        below)
      - window manager: FVWM 2.2.4 (configuration attached below)

      My test program creates a java.awt.Frame, sets it size, and sets it
      visible. After a delay, it sets a larger size. After another delay,
      is calls setVisible(true) again.

      When it sets the larger size, the window moves up and to the left,
      usually moving off the screen.

      In a little more detail:
      - When the window first appears, it briefly pops up somewhere in the
        middle of the screen (per my window manager's placement algorithm),
        and then moves to the upper left corner. (Separately, is that
        intended, a configuration problem, or a long-extant bug (1.3.something
        does that too)?)

      - When the program calls setSize, the window moves up and to the left,
        sometimes completely disappearing, sometimes leaving its lower right
        corner showing in the upper left of the display. If I switch to
        a virtual desktop that is down and to the right, I can see that the
        window has moved up and to the left and onto another virtual desktop.

      - When the program calls setVisible(true) again, the window reappears
        on the screen in a new location (apparently subject to the window
        manager's placement algorithm as if it were a new window).

      - The size of the reappeared window varies:

        - At first, I didn't notice a problem, so the size was probably right.

        - On later runs (with apparent reason for changing), the window had
          zero height but enough width for the normal window manager
          decoration (the title bar and some buttons).

        - No, the window has zero height. (The window manager decoration
          consists of only the border; no title bar or buttons appears.)

      Appended are:
      1: my test program
      2: my customizations to Debian's default FVWM configuration
      3: my XF86Config file

      1:--------------------------------------------------------------
      package temp;

      import java.awt.*;
      import java.awt.event.*;


      public class Various
      {

          public static void pause( int seconds )
          {
      try {
      Thread.sleep( seconds * 1000 );
      }
      catch ( InterruptedException e ) {
      }
          } // pause(...)


          public static void main( String[] args )
          {
      Frame frame = new Frame( "Various" );
      frame.setSize( 300, 200 );
      frame.setVisible( true );

      pause( 3 );
      // setSize moves window up and to the left, usually off the screen
      // or window another virtual desktop
      frame.setSize( 600, 400 );

      pause( 3 );
      // setVisible gets the window back onto the current virtual desktop,
      // seems to re-place the window (to subject the window to the
      // window manager's auto-placement algorithm again); the size
      // sometimes ends up correct, sometimes not)
      frame.setVisible( true );
          } // main( String[] )

      } // class Various
      --------------------------------------------------------------
      2:--------------------------------------------------------------

      Emulate Mwm
      Style "*" RandomPlacement
      Style "*" SmartPlacement
      OpaqueMoveSize 100
      AddToFunc Move-or-Raise "C" Raise
      + "M" Move
      + "D" Lower
      AddToFunc Resize-or-Raise "C" Raise
      + "M" Resize
      + "D" Lower
      AddToFunc Move-or-Lower "C" Lower
      + "M" Move
      + "D" Raise
      AddToFunc Resize-or-Lower "C" Lower
      + "M" Resize
      + "D" Raise
      Mouse 1 TS A Move-or-Raise
      Mouse 1 F A Resize-or-Raise
      Mouse 2 TS A Resize-or-Lower
      Mouse 2 F A Move-or-Lower
      DeskTopSize 2x2
      *FvwmPagerDeskTopScale 50
      Style "FvwmPager" Sticky
      Style "FvwmPager" StaysOnTop
      *FvwmPagerGeometry +50+0
      EdgeResistance 250 0
      *FvwmTaskBarGeometry -1-1
      *FvwmTaskBarShowTransients
      *FvwmTaskBarShowTips
      *FvwmTaskBarStartMenu "/Debian"
      *FvwmTaskBarUpdateInterval 1
      *FvwmTaskBarClockFormat %T
      Style "FvwmTaskBar" BorderWidth 10
      --------------------------------------------------------------
      3:--------------------------------------------------------------
      # XF86Config auto-generated by XF86Setup
      #
      # Copyright (c) 1996 by The XFree86 Project, Inc.

      #
      # Permission is hereby granted, free of charge, to any person obtaining a
      # copy of this software and associated documentation files (the "Software"),
      # to deal in the Software without restriction, including without limitation
      # the rights to use, copy, modify, merge, publish, distribute, sublicense,
      # and/or sell copies of the Software, and to permit persons to whom the
      # Software is furnished to do so, subject to the following conditions:
      #
      # The above copyright notice and this permission notice shall be included in
      # all copies or substantial portions of the Software.
      #
      # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      # THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
      # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
      # OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
      # SOFTWARE.
      #
      # Except as contained in this notice, the name of the XFree86 Project shall
      # not be used in advertising or otherwise to promote the sale, use or other
      # dealings in this Software without prior written authorization from the
      # XFree86 Project.
      #

      # See 'man XF86Config' for info on the format of this file

      Section "Files"
         RgbPath "/usr/X11R6/lib/X11/rgb"
         FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
         FontPath "/usr/X11R6/lib/X11/fonts/cyrillic:unscaled"
      #DSB: reversed 100 & 75
         FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
         FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
      #DSB: xxx??? might add URW fonts
      #DSB: xxx??? note Speedo/Type1 reversal (w.r.t. prev. setup)
         FontPath "/usr/X11R6/lib/X11/fonts/Speedo"
         FontPath "/usr/X11R6/lib/X11/fonts/Type1"
         FontPath "/usr/X11R6/lib/X11/fonts/misc"
         FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
      #DSB: reversed 100 & 75
         FontPath "/usr/X11R6/lib/X11/fonts/75dpi"
         FontPath "/usr/X11R6/lib/X11/fonts/100dpi"

         FontPath "/usr/X11R6/lib/X11/fonts/URW"
      EndSection

      Section "ServerFlags"
      EndSection

      Section "Keyboard"
         Protocol "Standard"

         # don't know what this does:
         XkbRules "xfree86"

         # "pc101" worked better than "pc104":
         # LAlt is Meta (emacs, xterm) and Alt (Netscape);
         # DSB: xxx???: let's try pc102 right now
         XkbModel "pc102"
         XkbLayout "en_US"
         XkbOptions "ctrl:swapcaps,grp:shift_toggle"

         # use Alt key instead of MSWindows key for Emacs, shell, Netscape functions
         # LeftAlt Meta
         # RightAlt Meta

      # What are legal values here?
      # Apparently:
      # keyword:
      # LeftAlt
      # RightAlt / AltGr
      # ScrollLock
      # RightCtl
      # mapping:
      # Meta
      # Compose
      # ModeShift
      # ModeLock
      # ScrollLock
      # Control
      # (From XF86Config manual page, which says abso-fucking-lutely NOTHING
      # about what ModeShift and ModeLock mean)
      # default mappings are:
      # LeftAlt Meta
      # RightAlt Meta
      # ScrollLock Compose
      # RightCtl Control
      EndSection

      Section "Pointer"
         Protocol "MouseSystems"
         Device "/dev/mouse"
         BaudRate 1200
         Resolution 100
         Buttons 3
      EndSection

      Section "Monitor"
         Identifier "Iiyama Vision Master 450"
         VendorName "Iiyama"
         ModelName "Vision Master 450"
         HorizSync 27-102
         VertRefresh 50-160
         Modeline "1600x1200" 202.50 1600 1664 1856 2160 1200 1201 1204 1250 +hsync
      +vsync
      #DSB: trying 1440x1080
         Modeline "1440x1080" 164.00 1440 1540 1716 1944 1080 1081 1084 1125 +hsync
      +vsync
         Modeline "1280x1024" 157.50 1280 1344 1504 1728 1024 1025 1028 1072 +hsync
      +vsync
         Modeline "1152x864" 137.65 1152 1184 1312 1536 864 866 885 902 -hsync
      -vsync
         Modeline "1024x768" 115.50 1024 1056 1248 1440 768 771 781 802 -hsync
      -vsync
         Modeline "800x600" 69.65 800 864 928 1088 600 604 610 640 -hsync -vsync
         Modeline "640x480" 45.80 640 672 768 864 480 488 494 530 -hsync -vsync
         Modeline "640x400" 31.50 640 672 736 832 400 401 404 445 -hsync +vsync
         Modeline "512x384" 22.00 512 528 592 640 384 385 388 404 -hsync -vsync
         Modeline "480x300" 29.95 480 504 584 624 300 319 322 333 doublescan
         Modeline "400x300" 25.00 400 424 488 520 300 319 322 333 doublescan
         Modeline "320x240" 15.75 320 336 384 400 240 244 246 262 doublescan
         Modeline "320x200" 12.59 320 336 384 400 200 204 205 225 doublescan
      EndSection

      Section "Device"
         Identifier "Diamond Viper V330"
         VendorName "Diamond"
         BoardName "Viper V330"
      #DSB: xxx??? from me?
         Option "power_saver"


      EndSection

      Section "Screen"
         Driver "Accel"
         Device "Diamond Viper V330"
         Monitor "Iiyama Vision Master 450"
      # DefaultColorDepth 16
      #DSB: for JDK 1.2
         DefaultColorDepth 15
         SubSection "Display"
            Depth 8
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 15
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 16
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 24
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 32
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
      EndSection

      Section "Screen"
         Driver "SVGA"
         Device "Diamond Viper V330"
         Monitor "Iiyama Vision Master 450"
      #DSB: xxx??? check special depth for current Java
      # DefaultColorDepth 16
      #DSB: for JDK 1.2
         DefaultColorDepth 15
         SubSection "Display"
            Depth 8
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 15
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 16
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 24
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
         SubSection "Display"
            Depth 32
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
      EndSection

      Section "Screen"
         Driver "VGA16"
         Device "Diamond Viper V330"
         Monitor "Iiyama Vision Master 450"
         SubSection "Display"
            Depth 4
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
      EndSection

      Section "Screen"
         Driver "VGA2"
         Device "Diamond Viper V330"
         Monitor "Iiyama Vision Master 450"
         SubSection "Display"
            Depth 1
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
      EndSection

      Section "Screen"
         Driver "Mono"
         Device "Diamond Viper V330"
         Monitor "Iiyama Vision Master 450"
         SubSection "Display"
            Depth 1
            Modes "1440x1080" "1280x1024" "1152x864" "1024x768" "800x600"
      "640x480" "640x400" "512x384" "480x300" "400x300" "320x240" "320x200" #
      "1600x1200"
         EndSubSection
      EndSection
      --------------------------------------------------------------
      (Review ID: 130591)
      ======================================================================

            vbaranovsunw Vyacheslav Baranov (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: