summaryrefslogtreecommitdiffstats
path: root/src/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-16 09:42:12 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-16 09:42:12 -0500
commitd359f91916add61887865a3f8931086c8b4b0a53 (patch)
treec76da9173cb760cabf342c8c6e1f689143557134 /src/kernel/qapplication_x11.cpp
parent7e8d6ff0bc1e5ac3742e3e5be42ff7d3ac7c98d4 (diff)
downloadtqt3-d359f91916add61887865a3f8931086c8b4b0a53.tar.gz
tqt3-d359f91916add61887865a3f8931086c8b4b0a53.zip
Automated update from Qt3
Diffstat (limited to 'src/kernel/qapplication_x11.cpp')
-rw-r--r--src/kernel/qapplication_x11.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index 5faeb3995..41abcb20e 100644
--- a/src/kernel/qapplication_x11.cpp
+++ b/src/kernel/qapplication_x11.cpp
@@ -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.