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

new JFrame window steals focus instead of letting window manager choose

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs
    • x86
    • linux

      Name: rmT116609 Date: 09/07/2004


      FULL PRODUCT VERSION :
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux dsb 2.4.18+dsb+smp+ide #1 SMP Wed Feb 12 15:39:11 EST 2003 i686 unknown

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Window manager is FVWM, in focus-follows-mouse mode
      (That is, a new window gets focus only if it lands under the cursor. If it doesn't get
      created under wherever the mouse cursor is, it doesn't normally get focus. (It doesn't
      get focus just because it's a new window))

      A DESCRIPTION OF THE PROBLEM :
      A new window (at least a new window for a JFrame) does something to take the focus
      instead of letting the window manager choose whether it gets focus.

      My window manager is configured with a "focus-follows-mouse" policy. Moving
      the mouse to another window gives focus to that second window. Additionally,
      when a new window appears, it (normally) gets focus _only_ if it appears under
      the current mouse location.

      However, a new JFrame window takes focus regardless of whether it appears under the
      mouse cursor.

      Therefore, some Swing or AWT code is doing something extra to take focus. Such code
      does not follow X Window System guidelines that say that applications should let the
      window manager manage windows (give focus, decide initial position, etc.).

      I know that you probably have to deal with specific window managers for fancier
      features, but for basic X11 functionality like this, please follow the rules. Even if
      you don't support fancy features on other window managers, make sure that it
      don't break generic X11 support.

      Specifically, don't assume that a new window is automatically raised to be the front-most
      window.

      Even if you can't support all features with window managers other than the ones
      you do support, at least check that generic X11 behavior doesn't break.




      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package test;

      import javax.swing.*;


      public class Main
      {


          public static void main( String[] args )
      throws Exception
          {
      JFrame window = new JFrame();
      window.setSize( 700, 900 );
      window.setVisible( true );

      Thread.sleep( 5 * 1000 );
      System.exit( 1 );
          } // main( String[] )


      } // class Main
      ---------- END SOURCE ----------
      (Incident Review ID: 302106)
      ======================================================================

            ant Anton Tarasov (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: