mod_skypiax: code before decl
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15765 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
302355202a
commit
dea8d99a81
|
@ -1544,8 +1544,8 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
|
||||||
#else /* NOT WIN32 */
|
#else /* NOT WIN32 */
|
||||||
int X11_errors_handler(Display * dpy, XErrorEvent * err)
|
int X11_errors_handler(Display * dpy, XErrorEvent * err)
|
||||||
{
|
{
|
||||||
(void) dpy;
|
|
||||||
private_t *tech_pvt = NULL;
|
private_t *tech_pvt = NULL;
|
||||||
|
(void) dpy;
|
||||||
|
|
||||||
xerror = err->error_code;
|
xerror = err->error_code;
|
||||||
ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); ///FIXME why crash the entire skypiax? just crash the interface, instead
|
ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); ///FIXME why crash the entire skypiax? just crash the interface, instead
|
||||||
|
@ -1567,17 +1567,13 @@ static int X11_errors_untrap(void)
|
||||||
|
|
||||||
int skypiax_send_message(private_t * tech_pvt, const char *message_P)
|
int skypiax_send_message(private_t * tech_pvt, const char *message_P)
|
||||||
{
|
{
|
||||||
struct SkypiaxHandles *SkypiaxHandles;
|
struct SkypiaxHandles *SkypiaxHandles = &tech_pvt->SkypiaxHandles;
|
||||||
Window w_P;
|
Window w_P = SkypiaxHandles->skype_win;
|
||||||
Display *disp;
|
Display *disp = SkypiaxHandles->disp;
|
||||||
Window handle_P;
|
Window handle_P = SkypiaxHandles->win;
|
||||||
int ok;
|
int ok;
|
||||||
//private_t *tech_pvt = NULL;
|
//private_t *tech_pvt = NULL;
|
||||||
|
|
||||||
SkypiaxHandles = &tech_pvt->SkypiaxHandles;
|
|
||||||
w_P = SkypiaxHandles->skype_win;
|
|
||||||
disp = SkypiaxHandles->disp;
|
|
||||||
handle_P = SkypiaxHandles->win;
|
|
||||||
|
|
||||||
Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
|
Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
|
||||||
Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False);
|
Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False);
|
||||||
|
@ -1699,6 +1695,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
|
||||||
Display *disp = NULL;
|
Display *disp = NULL;
|
||||||
Window root = -1;
|
Window root = -1;
|
||||||
Window win = -1;
|
Window win = -1;
|
||||||
|
int xfd;
|
||||||
|
|
||||||
if (!strlen(tech_pvt->X11_display))
|
if (!strlen(tech_pvt->X11_display))
|
||||||
strcpy(tech_pvt->X11_display, getenv("DISPLAY"));
|
strcpy(tech_pvt->X11_display, getenv("DISPLAY"));
|
||||||
|
@ -1723,7 +1720,6 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
|
||||||
DEBUGA_SKYPE("X Display '%s' opened\n", SKYPIAX_P_LOG, tech_pvt->X11_display);
|
DEBUGA_SKYPE("X Display '%s' opened\n", SKYPIAX_P_LOG, tech_pvt->X11_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
int xfd;
|
|
||||||
xfd = XConnectionNumber(disp);
|
xfd = XConnectionNumber(disp);
|
||||||
fcntl(xfd, F_SETFD, FD_CLOEXEC);
|
fcntl(xfd, F_SETFD, FD_CLOEXEC);
|
||||||
|
|
||||||
|
@ -1754,6 +1750,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
/* perform an events loop */
|
/* perform an events loop */
|
||||||
XEvent an_event;
|
XEvent an_event;
|
||||||
char buf[21]; /* can't be longer */
|
char buf[21]; /* can't be longer */
|
||||||
|
@ -1847,6 +1844,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG);
|
ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG);
|
||||||
running = 0;
|
running = 0;
|
||||||
|
|
Loading…
Reference in New Issue