b=814200 listen only to necessary Xt events and be explicit about those events r=stransky
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 04 Jan 2013 12:37:08 +1300
changeset 117538 cffc2daf1e91
parent 117537 6bd9494f9be3
child 117539 df9fd7cdd333
push id20560
push userktomlinson@mozilla.com
push date2013-01-04 00:46 +0000
treeherdermozilla-inbound@04578917e3d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstransky
bugs814200
milestone20.0a1
b=814200 listen only to necessary Xt events and be explicit about those events r=stransky
widget/gtkxtbin/gtk2xtbin.c
--- a/widget/gtkxtbin/gtk2xtbin.c
+++ b/widget/gtkxtbin/gtk2xtbin.c
@@ -546,22 +546,22 @@ xt_client_create ( XtClient* xtclient ,
                XtBuildEventMask(top_widget));
   xt_client_set_info (child_widget, 0);
 
   XtManageChild(child_widget);
   xtclient->child_widget = child_widget;
 
   /* set the event handler */
   XtAddEventHandler(child_widget,
-                    0x0FFFFF & ~ResizeRedirectMask,
+                    StructureNotifyMask | KeyPressMask,
                     TRUE, 
                     (XtEventHandler)xt_client_event_handler, xtclient);
   XtAddEventHandler(child_widget, 
                     SubstructureNotifyMask | ButtonReleaseMask, 
-                    TRUE, 
+                    FALSE,
                     (XtEventHandler)xt_client_focus_listener, 
                     xtclient);
   XSync(xtclient->xtdisplay, FALSE);
 }
 
 void
 xt_client_unrealize ( XtClient* xtclient )
 {
@@ -585,17 +585,19 @@ xt_client_unrealize ( XtClient* xtclient
   xtclient->top_widget->core.window = xtclient->oldwindow;
   XtUnrealizeWidget(xtclient->top_widget);
 }
 
 void            
 xt_client_destroy   (XtClient* xtclient)
 {
   if(xtclient->top_widget) {
-    XtRemoveEventHandler(xtclient->child_widget, 0x0FFFFF, TRUE, 
+    XtRemoveEventHandler(xtclient->child_widget,
+                         StructureNotifyMask | KeyPressMask,
+                         TRUE, 
                          (XtEventHandler)xt_client_event_handler, xtclient);
     XtDestroyWidget(xtclient->top_widget);
     xtclient->top_widget = NULL;
   }
 }
 
 void         
 xt_client_set_info (Widget xtplug, unsigned long flags)
@@ -692,22 +694,16 @@ xt_client_event_handler( Widget w, XtPoi
     case ReparentNotify:
       break;
     case MappingNotify:
       xt_client_set_info (w, XEMBED_MAPPED);
       break;
     case UnmapNotify:
       xt_client_set_info (w, 0);
       break;
-    case FocusIn:
-      send_xembed_message ( xtplug,
-                            XEMBED_REQUEST_FOCUS, 0, 0, 0, 0);
-      break;
-    case FocusOut:
-      break;
     case KeyPress:
 #ifdef DEBUG_XTBIN
       printf("Key Press Got!\n");
 #endif
       break;
     default:
       break;
     } /* End of switch(event->type) */
@@ -831,29 +827,29 @@ xt_add_focus_listener( Widget w, XtPoint
   XGetWindowAttributes(XtDisplay(w), XtWindow(w), &attr);
   eventmask = attr.your_event_mask | SubstructureNotifyMask | ButtonReleaseMask;
   XSelectInput(XtDisplay(w),
                XtWindow(w), 
                eventmask);
 
   XtAddEventHandler(w, 
                     SubstructureNotifyMask | ButtonReleaseMask, 
-                    TRUE, 
+                    FALSE, 
                     (XtEventHandler)xt_client_focus_listener, 
                     xtclient);
   untrap_error();
 }
 
 static void
 xt_remove_focus_listener(Widget w, XtPointer user_data)
 {
   int errorcode;
 
   trap_errors ();
-  XtRemoveEventHandler(w, SubstructureNotifyMask | ButtonReleaseMask, TRUE, 
+  XtRemoveEventHandler(w, SubstructureNotifyMask | ButtonReleaseMask, FALSE, 
                       (XtEventHandler)xt_client_focus_listener, user_data);
 
   untrap_error();
 }
 
 static void
 xt_add_focus_listener_tree ( Widget treeroot, XtPointer user_data) 
 {