1
diff -r -pu xulrunner-1.9.2a1pre~20090805/widget/src/headless/nsWindow.cpp new/widget/src/headless/nsWindow.cpp
2
--- xulrunner-1.9.2a1pre~20090805/widget/src/headless/nsWindow.cpp 2009-07-31 12:31:58.000000000 +0100
3
+++ new/widget/src/headless/nsWindow.cpp 2009-08-14 17:00:17.000000000 +0100
4
@@ -1634,7 +1634,8 @@ nsWindow::SetPluginType(PluginType aPlug
6
nsWindow::SetNonXEmbedPluginFocus()
8
- if (gPluginFocusWindow == this || mPluginType!=PluginType_NONXEMBED) {
9
+ // XEmbed plugin also needs the method to set focus
10
+ if (gPluginFocusWindow == this /*|| mPluginType!=PluginType_NONXEMBED*/) {
14
@@ -1668,9 +1669,15 @@ nsWindow::SetNonXEmbedPluginFocus()
15
// lookup with the focus proxy window is supposed to get the
16
// same GdkWindow as toplevel. If the current focused window
17
// is not the focus proxy, we return without any change.
19
+ //in headless, gdkfocuswin is null, so remove this condition
20
+ //plugin focus will be set when mouse pointer enter
21
+ //and focus will be lost when mouse pointer leave
23
if (gdkfocuswin != toplevel) {
28
// switch the focus from the focus proxy to the plugin window
29
mOldFocusWindow = curFocusWindow;
30
@@ -1698,7 +1705,8 @@ nsWindow::LoseNonXEmbedPluginFocus()
32
// This method is only for the nsWindow which contains a
33
// Non-XEmbed plugin, for example, JAVA plugin.
34
- if (gPluginFocusWindow != this || mPluginType!=PluginType_NONXEMBED) {
35
+ // XEmbed plugin also needs this method to lose focus
36
+ if (gPluginFocusWindow != this /*|| mPluginType!=PluginType_NONXEMBED*/) {
40
@@ -1783,6 +1791,9 @@ nsWindow::PluginWindowXEventFilterFunc(G
42
nswindow->SetNonXEmbedPluginFocus();
45
+ nswindow->LoseNonXEmbedPluginFocus();
48
// Currently we consider all plugins are non-xembed and calls
49
// LoseNonXEmbedPluginFocus without any checking.