|
|
|
@ -1803,18 +1803,26 @@ void tqt_init_internal( int *argcptr, char **argv,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
// Connect to X server
|
|
|
|
|
|
|
|
|
|
if( tqt_is_gui_used ) {
|
|
|
|
|
if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) {
|
|
|
|
|
tqWarning( "%s: cannot connect to X server %s", appName,
|
|
|
|
|
XDisplayName(appDpyName) );
|
|
|
|
|
tqApp = 0;
|
|
|
|
|
exit( 1 );
|
|
|
|
|
}
|
|
|
|
|
if ( display ) {
|
|
|
|
|
// Display connection already opened by another application
|
|
|
|
|
|
|
|
|
|
if ( appSync ) // if "-sync" argument
|
|
|
|
|
XSynchronize( appDpy, TRUE );
|
|
|
|
|
appForeignDpy = TRUE;
|
|
|
|
|
appDpy = display;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Connect to X server
|
|
|
|
|
|
|
|
|
|
if( tqt_is_gui_used ) {
|
|
|
|
|
if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) {
|
|
|
|
|
tqWarning( "%s: cannot connect to X server %s", appName,
|
|
|
|
|
XDisplayName(appDpyName) );
|
|
|
|
|
tqApp = 0;
|
|
|
|
|
exit( 1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( appSync ) // if "-sync" argument
|
|
|
|
|
XSynchronize( appDpy, TRUE );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Common code, regardless of whether display is foreign.
|
|
|
|
|