[PATCH] Split sn_internal_xmessage_process_event

Julien Danjou julien at danjou.info
Thu Jan 29 06:37:45 PST 2009


Signed-off-by: Julien Danjou <julien at danjou.info>
---
 libsn/sn-xmessages.c |   49 ++++++++++++++++++++++++++-----------------------
 1 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/libsn/sn-xmessages.c b/libsn/sn-xmessages.c
index 6a10174..ed1df71 100644
--- a/libsn/sn-xmessages.c
+++ b/libsn/sn-xmessages.c
@@ -426,29 +426,10 @@ dispatch_message_foreach (void *value,
   return TRUE;
 }
 
-sn_bool_t
-sn_internal_xmessage_process_event (SnDisplay *display,
-                                    XEvent    *xevent)
+static void
+xmessage_process_message (SnDisplay *display, SnXmessage *message)
 {
-  sn_bool_t retval;
-  SnXmessage *message;
-
-  retval = FALSE;
-  message = NULL;
-  
-  switch (xevent->xany.type)
-    {
-    case ClientMessage:
-      if (some_handler_handles_event (display, xevent))
-        {
-          retval = TRUE;
-          
-          message = add_event_to_messages (display, xevent);
-        }
-      break;
-    }
-
-  if (message != NULL)
+  if (message)
     {
       /* We need to dispatch and free this message; ignore
        * messages containing invalid UTF-8
@@ -483,7 +464,29 @@ sn_internal_xmessage_process_event (SnDisplay *display,
       sn_free (message->message);
       sn_free (message);
     }
-  
+}
+
+sn_bool_t
+sn_internal_xmessage_process_event (SnDisplay *display,
+                                    XEvent    *xevent)
+{
+  sn_bool_t retval = FALSE;
+  SnXmessage *message = NULL;
+
+  switch (xevent->xany.type)
+    {
+    case ClientMessage:
+      if (some_handler_handles_event (display, xevent))
+        {
+          retval = TRUE;
+
+          message = add_event_to_messages (display, xevent);
+        }
+      break;
+    }
+
+  xmessage_process_message (display, message);
+
   return retval;
 }
 
-- 
1.5.6.5



More information about the xdg mailing list