~moblin/xulrunner/xulrunner-headless-1.9.2

« back to all changes in this revision

Viewing changes to debian/patches/plugin-focus.patch

  • Committer: Michael Terry
  • Date: 2009-09-29 18:25:37 UTC
  • Revision ID: michael.terry@canonical.com-20090929182537-pkj6hf8qsotya3vi
   * New upstream snapshot
   * debian/patches/remove-global-local-storage.patch: remove globalStorage
     and localStorage properties from the DOM so clients correctly detect that
     we don't support DOM storage.  From Fedora Moblin packaging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 void
 
6
 nsWindow::SetNonXEmbedPluginFocus()
 
7
 {
 
8
-    if (gPluginFocusWindow == this || mPluginType!=PluginType_NONXEMBED) {
 
9
+    // XEmbed plugin also needs the method to set focus
 
10
+    if (gPluginFocusWindow == this /*|| mPluginType!=PluginType_NONXEMBED*/) {
 
11
         return;
 
12
     }
 
13
 
 
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.
 
18
+
 
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
 
22
+    /*
 
23
     if (gdkfocuswin != toplevel) {
 
24
         return;
 
25
     }
 
26
+    */
 
27
 
 
28
     // switch the focus from the focus proxy to the plugin window
 
29
     mOldFocusWindow = curFocusWindow;
 
30
@@ -1698,7 +1705,8 @@ nsWindow::LoseNonXEmbedPluginFocus()
 
31
 
 
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*/) {
 
37
         return;
 
38
     }
 
39
 
 
40
@@ -1783,6 +1791,9 @@ nsWindow::PluginWindowXEventFilterFunc(G
 
41
         case EnterNotify:
 
42
             nswindow->SetNonXEmbedPluginFocus();
 
43
             break;
 
44
+        case LeaveNotify:
 
45
+            nswindow->LoseNonXEmbedPluginFocus();
 
46
+            break;
 
47
         case DestroyNotify:
 
48
             // Currently we consider all plugins are non-xembed and calls
 
49
             // LoseNonXEmbedPluginFocus without any checking.