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

WINDOW_ACTIVATED and WINDOW_ DEACTIVATED events are not always fired

XMLWordPrintable

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

      Config: Linux + Sawfish/Enligntenment + jdk 1.3.1_01

      WINDOW_DEACTIVATED and WINDOW_ACTIVATED events are expected to be fired when the
      user switches the focus from/to an AWT Frame. This does not happen if the user uses Alt+TAB
      to do the switching. This causes a significant problem for Forte for Java/NetBeans IDE.
      See the IDE bug description at
       
      http://www.netbeans.org/issues/show_bug.cgi?id=16755

      After playing with xev utility and studying JDK source code I conclude
      that this is a bug in JDK. XEvent of FocusIn/FocusOut type
      is mapped and routed to java.awt.Window iff xev->mode == NotifyNormal,
      which does not hold when switching b/w native windows using Alt+Tab.

      For jdk 1.3.1 we can work around the bug by hooking into AWTEvent queue
      (using AWTEventListener) and react to FOCUS_GAINED event. The hack is
      extremely ugly but it works. On JDK 1.4 beta3 even FOCUS_GAINED is not
      fired so we are out of luck.

      Although the testing environment is Linux + Sawfish, I suspect that the same
      defect is present on Solaris+CDE

            dmikhalksunw Denis Mikhalkin (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: