Closed Bug 868005 Opened 11 years ago Closed 7 years ago

Java applet steals focus from the location bar

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86_64
Windows 7
defect

Tracking

(firefox48 affected, firefox49 affected, firefox50 affected, firefox51 affected)

RESOLVED WONTFIX
Tracking Status
firefox48 --- affected
firefox49 --- affected
firefox50 --- affected
firefox51 --- affected

People

(Reporter: pauly, Unassigned)

References

Details

(Whiteboard: p=13)

STR:
1. Open http://wickedgoodgames.com/java2/asteroids.html
2. Click on the location bar and then press END key
3. Click on the applet and press "S" to start the game
4. Click on the location bar and try to type anything

AR: Unable to type in the location bar

Repro on FF 4 - 23.0a1
This is a regression in Java 7. It is not repro on Java 6.
See Also: → 718939
See Also: → 382906
Priority: -- → P3
Is this a regression from a particular version in the Java 7 branch?
Latest j6u43 is good.
First j7 is bad.
I'm not yet convinced that is just a Java problem.
Tracing the keyboard and focus window messages i see that we never set focus back to the browser window.

jimm, could you suggest where to check next? Could this be an issue with our windows widgets?

Spy++ results following, with the window hierarchy being:
0006054C - MozillaWindowClass (main window)
  0004064A - MozillaWindowClass
    0004064A - SunAwtFrame
      00040648 - SunAwtCanvas

Set focus to url bar:
<00001> 0006054C S WM_SETFOCUS hwndLoseFocus:(null)
<00002> 0006054C R WM_SETFOCUS

input character in url bar:
<00003> 0006054C P WM_KEYDOWN nVirtKey:'B' cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00004> 0006054C P WM_CHAR chCharCode:'98' (98) cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00005> 0006054C P WM_KEYUP nVirtKey:'B' cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:1 fUp:1

click on plugin window:
<00006> 0006054C S WM_KILLFOCUS hwndGetFocus:0004064A
<00007> 0004064A S WM_SETFOCUS hwndLoseFocus:0006054C
<00008> 0004064A R WM_SETFOCUS
<00009> 00040648 S WM_SETFOCUS hwndLoseFocus:(null)
<00010> 00040648 R WM_SETFOCUS

input character in plugin window:
<00011> 0004064A P WM_KEYDOWN nVirtKey:'S' cRepeat:1 ScanCode:1F fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00012> 0004064A P WM_CHAR chCharCode:'115' (115) cRepeat:1 ScanCode:1F fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00013> 0004064A P WM_KEYUP nVirtKey:'S' cRepeat:1 ScanCode:1F fExtended:0 fAltDown:0 fRepeat:1 fUp:1

click on url bar:
... nothing

input character, still going to plugin window:
<00014> 0004064A P WM_KEYDOWN nVirtKey:'B' cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00015> 0004064A P WM_CHAR chCharCode:'98' (98) cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<00016> 0004064A P WM_KEYUP nVirtKey:'B' cRepeat:1 ScanCode:30 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
Flags: needinfo?(jmathies)
(In reply to Georg Fritzsche [:gfritzsche] from comment #3)
> with the window hierarchy being:
> 0006054C - MozillaWindowClass (main window)
>   0004064A - MozillaWindowClass
>     0004064A - SunAwtFrame
>       00040648 - SunAwtCanvas

Typo for the second one, that should be:
 0006054C - MozillaWindowClass (main window)
   0004064C - MozillaWindowClass
     0004064A - SunAwtFrame
       00040648 - SunAwtCanvas
On the second click into the applet, looks like the main window doesn't get a lost focus message. The address bar thinks it still has keyboard focus but doesn't. You can work around this by clicking applet -> content -> address bar -> content -> applet. This seems to be the root of the problem.
Flags: needinfo?(jmathies)
Sorry, i missed the follow-up here... Do you think this a problem with the Java plugins window handling or our widgets? Do you know what i should look for to verify?
Flags: needinfo?(jmathies)
(In reply to Georg Fritzsche [:gfritzsche] from comment #6)
> Sorry, i missed the follow-up here... Do you think this a problem with the
> Java plugins window handling or our widgets? Do you know what i should look
> for to verify?

I would look at plugin window messages, see what we receive there. We have subclasses on the root plugin window so if it receives something we can key off of we can make sure focus manager knows the state of the browser window.
Flags: needinfo?(jmathies)
Thanks Jim.

I'm taking this for now, but with the other things going on i will probably not get to this very soon.
Assignee: nobody → georg.fritzsche
Component: Java (Oracle) → Plug-ins
Product: Plugins → Core
Version: 7.x → Trunk
Assignee: georg.fritzsche → nobody
Flags: firefox-backlog?
Flags: firefox-backlog? → firefox-backlog+
Whiteboard: p=13
This bug has reappeared as of Version 48.0.2
Confirmed in 51.0a1 (2016-09-05) Win 7.
I'm marking this bug as WONTFIX per bug #1269807.

For more information see - https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.