提交 5c2fa74f authored 作者: Giovanni Maruzzelli's avatar Giovanni Maruzzelli 提交者: root

let's use XFlush instead of XSync, helps broken XLib

Signed-off-by: 's avatarroot <root@server1.celliax.org>
上级 cf9ddfa8
...@@ -87,7 +87,8 @@ int skypopen_send_message(struct SkypopenHandles *SkypopenHandles, const char *m ...@@ -87,7 +87,8 @@ int skypopen_send_message(struct SkypopenHandles *SkypopenHandles, const char *m
pos += i; pos += i;
} while (pos <= len); } while (pos <= len);
XSync(disp, False); //giovanni XSync(disp, False);
XFlush(disp);
ok = X11_errors_untrap(); ok = X11_errors_untrap();
if (!ok) if (!ok)
......
...@@ -364,6 +364,8 @@ static switch_status_t remove_interface(char *the_interface) ...@@ -364,6 +364,8 @@ static switch_status_t remove_interface(char *the_interface)
if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) { if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) {
XEvent e; XEvent e;
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); 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)); memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage; e.xclient.type = ClientMessage;
e.xclient.message_type = atom1; /* leading message */ e.xclient.message_type = atom1; /* leading message */
...@@ -372,7 +374,8 @@ static switch_status_t remove_interface(char *the_interface) ...@@ -372,7 +374,8 @@ static switch_status_t remove_interface(char *the_interface)
e.xclient.format = 8; e.xclient.format = 8;
XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e); 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 #endif
} }
...@@ -1500,6 +1503,7 @@ static switch_status_t load_config(int reload_type) ...@@ -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); SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user);
/* giovanni*/
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7"); skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7");
switch_sleep(10000); switch_sleep(10000);
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF"); skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF");
...@@ -1516,6 +1520,7 @@ static switch_status_t load_config(int reload_type) ...@@ -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"); skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
switch_sleep(10000); switch_sleep(10000);
} }
/* giovanni */
} else { } else {
ERRORA 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", ("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) ...@@ -1742,6 +1747,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
XEvent e; XEvent e;
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN",
False); False);
switch_sleep(1000);//giovanni
XFlush(tech_pvt->SkypopenHandles.disp); //giovanni
memset(&e, 0, sizeof(e)); memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage; e.xclient.type = ClientMessage;
e.xclient.message_type = atom1; /* leading message */ e.xclient.message_type = atom1; /* leading message */
...@@ -1750,7 +1757,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown) ...@@ -1750,7 +1757,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
e.xclient.format = 8; e.xclient.format = 8;
XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e); 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 #endif
} }
......
...@@ -1458,6 +1458,9 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P) ...@@ -1458,6 +1458,9 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P)
unsigned int len = strlen(message_P); unsigned int len = strlen(message_P);
XEvent e; XEvent e;
skypopen_sleep(1000);//giovanni
XFlush(disp);//giovanni
memset(&e, 0, sizeof(e)); memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage; e.xclient.type = ClientMessage;
e.xclient.message_type = atom1; /* leading message */ e.xclient.message_type = atom1; /* leading message */
...@@ -1476,7 +1479,8 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P) ...@@ -1476,7 +1479,8 @@ int skypopen_send_message(private_t * tech_pvt, const char *message_P)
pos += i; pos += i;
} while (pos <= len); } while (pos <= len);
XSync(disp, False); //giovanni XSync(disp, False);
XFlush(disp);
ok = X11_errors_untrap(); ok = X11_errors_untrap();
if (!ok) { if (!ok) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论