Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6613426
Votes 0
Synopsis two WM_TAKE_FOCUS messages on one mouse click in GNOME Metacity 2.16.0
Category java:classes_awt
Reported Against
Release Fixed 7(b27)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 05-OCT-2007
Description
OS: Linux Fedora Core 6, GNOME Metacity 2.16.0 (not reproducible on KDE)
JDK: 7.0 b18

There's an owner Frame F1 and its owned Window with a button insude. There's also
another Frame F2. I'm clicking the button - the Window becomes the focused window,
F1 becomes the active window. Then I'm clicking F2, it gains focus, and then I'm
clicking F1's title.

EXPECTED:
The button in the Window should gain focus as it had it before.

ACTUAL:
The button gains focus, but then F1 immediately steals it.

It can be reproduced with the following regression test:
test/closed/java/awt/Focus/ActualFocusWindowRetaining/ActualFocusWindowRetaining.java
Posted Date : 2007-10-05 10:02:48.0
Work Around
N/A
Evaluation
The problem is as follows. When I'm clicking F1's title it receives WM_TAKE_FOCUS msg.
Focus is requested on F1 (XDecoratedPeer.requestWindowFocus() method). Native focus
is set to the focus proxy window (a child of F1). After it receives FocusIn the window
manager again sends F1 WM_TAKE_FOCUS msg. The second WM_TAKE_FOCUS causes the Frame to request focus again. By this time the owned Window is already sent WINDOW_GAINED_FOCUS
and the actualFocusedWindow field of the Frame is set to null. Thus, it requests focus
on itself.

A solution would be to reject requesting focus on receiving WM_TAKE_FOCUS in case
the Frame is already the native focused window.
Posted Date : 2007-10-05 10:02:48.0

A bug is filed against Metacity 2.16.x:

http://bugzilla.gnome.org/show_bug.cgi?id=485016
Bug 485016 – Two WM_TAKE_FOCUS messages on single click in the title of a window.
Posted Date : 2007-10-09 12:44:55.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang