Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 8604cbc4d16ebbba706929d8df6004ee > files > 2

nspluginwrapper-1.1.0-7mdv2009.0.src.rpm

diff -up nspluginwrapper-0.9.91.5/src/npw-viewer.c.sleep nspluginwrapper-0.9.91.5/src/npw-viewer.c
--- nspluginwrapper-0.9.91.5/src/npw-viewer.c.sleep	2008-03-10 12:50:21.000000000 +0100
+++ nspluginwrapper-0.9.91.5/src/npw-viewer.c	2008-03-10 12:51:42.000000000 +0100
@@ -3039,14 +3039,14 @@ static GPollFD xt_event_poll_fd;
 static gboolean xt_event_prepare(GSource *source, gint *timeout)
 {
   int mask = XtAppPending(x_app_context);
-  return mask & XtIMXEvent;
+  return mask;
 }
 
 static gboolean xt_event_check(GSource *source)
 {
   if (xt_event_poll_fd.revents & G_IO_IN) {
 	int mask = XtAppPending(x_app_context);
-	if (mask & XtIMXEvent)
+	if (mask)
 	  return TRUE;
   }
   return FALSE;
@@ -3054,12 +3054,11 @@ static gboolean xt_event_check(GSource *
 
 static gboolean xt_event_dispatch(GSource *source, GSourceFunc callback, gpointer user_data)
 {
-  int i;
-  for (i = 0; i < 5; i++) {
+  while(1) {
 	int mask = XtAppPending(x_app_context);
-	if ((mask & XtIMXEvent) == 0)
+	if ((mask) == 0)
 	  break;
-	XtAppProcessEvent(x_app_context, XtIMXEvent);
+	XtAppProcessEvent(x_app_context, XtIMAll);
   }
   return TRUE;
 }
@@ -3073,17 +3072,6 @@ static GSourceFuncs xt_event_funcs = {
   (GSourceDummyMarshal)NULL
 };
 
-static gboolean xt_event_polling_timer_callback(gpointer user_data)
-{
-  int i;
-  for (i = 0; i < 5; i++) {
-	if ((XtAppPending(x_app_context) & (XtIMAll & ~XtIMXEvent)) == 0)
-	  break;
-	XtAppProcessEvent(x_app_context, XtIMAll & ~XtIMXEvent);
-  }
-  return TRUE;
-}
-
 // RPC events
 static GPollFD rpc_event_poll_fd;
 
@@ -3208,10 +3196,6 @@ static int do_main(int argc, char **argv
   xt_event_poll_fd.revents = 0;
   g_source_add_poll(xt_source, &xt_event_poll_fd);
 
-  gint xt_polling_timer_id = g_timeout_add(25,
-										   xt_event_polling_timer_callback,
-										   NULL);
-
   // Initialize RPC events listener
   GSource *rpc_source = g_source_new(&rpc_event_funcs, sizeof(GSource));
   if (rpc_source == NULL) {
@@ -3232,7 +3216,6 @@ static int do_main(int argc, char **argv
   gtk_main();
   D(bug("--- EXIT ---\n"));
 
-  g_source_remove(xt_polling_timer_id);
   g_source_destroy(rpc_source);
   g_source_destroy(xt_source);