diff options
author | Eion Robb <eion@robbmob.com> | 2008-06-17 04:13:13 +0400 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2008-06-17 04:13:13 +0400 |
commit | b5a21be0ca3fafc8e69627a75095712a104965ff (patch) | |
tree | 08c052b53b3e8c36a2eb1d5f326af3ae8c990482 | |
parent | daf5d3c5e7f44d033d684477d62b91d70ac84f14 (diff) |
Undo previous commit, do some error checking instead
-rw-r--r-- | skype_messaging_x11.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/skype_messaging_x11.c b/skype_messaging_x11.c index d7cf10b..52991b4 100644 --- a/skype_messaging_x11.c +++ b/skype_messaging_x11.c @@ -24,7 +24,6 @@ skype_connect() unsigned char *prop;
int status;
- XInitThreads();
XSetErrorHandler(x11_error_handler); #ifdef USE_XVFB_SERVER if (getenv("SKYPEDISPLAY")) @@ -163,15 +162,6 @@ send_message(char* message) }
} -Bool -check_for_clientmessage_predicate(Display *display, XEvent *event, XPointer arg) -{ - printf("skype x11 debug: %d %d\n", event->type, ClientMessage); - if (event && event->type == ClientMessage) - return True; - return False; -}
-
static void
receive_message_loop(void)
{
@@ -187,9 +177,10 @@ receive_message_loop(void) if (!disp)
{
skype_debug_error("skype_x11", "display has disappeared\n");
+ g_thread_create((GThreadFunc)skype_message_received, "CONNSTATUS LOGGEDOUT", FALSE, NULL);
break;
} - //XIfEvent(disp, &e, check_for_clientmessage_predicate, NULL);
+ event_bool = XCheckTypedEvent(disp, ClientMessage, &e);
if (!event_bool)
{
@@ -205,15 +196,17 @@ receive_message_loop(void) msg = g_string_append_len(msg, msg_temp, len);
else
{
- skype_debug_info("skype_x11", "unknown message type: %d\n", e.xclient.message_type);
- XFlush(disp);
+ skype_debug_info("skype_x11", "unknown message type: %d\n", e.xclient.message_type); + if (disp)
+ XFlush(disp);
continue;
}
if (len < 20)
{
- g_thread_create((GThreadFunc)skype_message_received, (void *)g_string_free(msg, FALSE), FALSE, NULL);
- XFlush(disp);
+ g_thread_create((GThreadFunc)skype_message_received, (void *)g_string_free(msg, FALSE), FALSE, NULL); + if (disp)
+ XFlush(disp);
}
}
}
|