]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
let's use XFlush instead of XSync, helps broken XLib
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Tue, 20 Jul 2010 16:10:58 +0000 (11:10 -0500)
committerroot <root@server1.celliax.org>
Tue, 20 Jul 2010 16:12:22 +0000 (11:12 -0500)
Signed-off-by: root <root@server1.celliax.org>
src/mod/endpoints/mod_skypopen/configs/client.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
src/mod/endpoints/mod_skypopen/skypopen_protocol.c

index 87c4c6c422d444dc9bb9ec966addf03bdc5a88dd..062281d6416bcf03652e0c7452a99f8d0fe979ea 100644 (file)
@@ -87,7 +87,8 @@ int skypopen_send_message(struct SkypopenHandles *SkypopenHandles, const char *m
                pos += i;
        } while (pos <= len);
 
-       XSync(disp, False);
+       //giovanni XSync(disp, False);
+       XFlush(disp);
        ok = X11_errors_untrap();
 
        if (!ok)
index 97d0ce6778d37cb260cdb347814ecd7db5968828..3c415245506b7e851472b9f7944b4fb43bdf88a4 100644 (file)
@@ -364,6 +364,8 @@ static switch_status_t remove_interface(char *the_interface)
                if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) {
                        XEvent e;
                        Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
+                       switch_sleep(1000);//giovanni
+                       XFlush(tech_pvt->SkypopenHandles.disp); //giovanni
                        memset(&e, 0, sizeof(e));
                        e.xclient.type = ClientMessage;
                        e.xclient.message_type = atom1; /*  leading message */
@@ -372,7 +374,8 @@ static switch_status_t remove_interface(char *the_interface)
                        e.xclient.format = 8;
 
                        XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e);
-                       XSync(tech_pvt->SkypopenHandles.disp, False);
+                       //giovanni XSync(tech_pvt->SkypopenHandles.disp, False);
+                       XFlush(tech_pvt->SkypopenHandles.disp); //giovanni
                }
 #endif
        }
@@ -1500,6 +1503,7 @@ static switch_status_t load_config(int reload_type)
                                                 SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user);
 
 
+/* giovanni*/
                                        skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7");
                                        switch_sleep(10000);
                                        skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF");
@@ -1516,6 +1520,7 @@ static switch_status_t load_config(int reload_type)
                                                skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
                                                switch_sleep(10000);
                                        }
+/*  giovanni */
                                } else {
                                        ERRORA
                                                ("The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypopen exiting now\n",
@@ -1742,6 +1747,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
                                        XEvent e;
                                        Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN",
                                                                                         False);
+                       switch_sleep(1000);//giovanni
+                       XFlush(tech_pvt->SkypopenHandles.disp); //giovanni
                                        memset(&e, 0, sizeof(e));
                                        e.xclient.type = ClientMessage;
                                        e.xclient.message_type = atom1; /*  leading message */
@@ -1750,7 +1757,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
                                        e.xclient.format = 8;
 
                                        XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e);
-                                       XSync(tech_pvt->SkypopenHandles.disp, False);
+                                       //giovanni XSync(tech_pvt->SkypopenHandles.disp, False);
+                       XFlush(tech_pvt->SkypopenHandles.disp); //giovanni
                                }
 #endif
                        }
index 77568c6e5c7802928588e9c62f871fdcb570e002..6f4fc33b65187f25e54c30706be4b95207bff184 100644 (file)
@@ -1458,6 +1458,9 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P)
        unsigned int len = strlen(message_P);
        XEvent e;
 
+skypopen_sleep(1000);//giovanni
+       XFlush(disp);//giovanni
+
        memset(&e, 0, sizeof(e));
        e.xclient.type = ClientMessage;
        e.xclient.message_type = atom1; /*  leading message */
@@ -1476,7 +1479,8 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P)
                pos += i;
        } while (pos <= len);
 
-       XSync(disp, False);
+       //giovanni XSync(disp, False);
+       XFlush(disp);
        ok = X11_errors_untrap();
 
        if (!ok) {