1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
qt-bugs@ issue : none
bugs.kde.org number : 83974
applied: no
author: Lubos Lunak <l.lunak@kde.org>
An ugly hack to get real transparency in Konsole working somehow, with Qt not having
any support for the ARGB visual. QApplication has one ctor that allows passing
any X connection and X visual, but that has some side effects, so this patch
adds a magic flag to turn the side effects off.
--- src/kernel/qapplication.cpp.sav 2007-02-23 14:01:19.000000000 +0100
+++ src/kernel/qapplication.cpp 2007-05-29 15:42:39.000000000 +0200
@@ -317,6 +317,7 @@ void qt_init( int *, char **, QApplicati
void qt_cleanup();
#if defined(Q_WS_X11)
void qt_init( Display* dpy, Qt::HANDLE, Qt::HANDLE );
+void qt_init( int *, char **, Display* dpy, Qt::HANDLE, Qt::HANDLE );
#endif
Q_EXPORT bool qt_tryModalHelper( QWidget *widget, QWidget **rettop );
@@ -905,7 +906,7 @@ QApplication::QApplication(Display *dpy,
qt_init( &argc, argv, GuiClient );
} else {
- qt_init(dpy, visual, colormap);
+ qt_init( &argc, argv, dpy, visual, colormap);
}
process_cmdline( &argc, argv );
--- src/kernel/qapplication_x11.cpp.sav 2007-05-25 18:56:23.000000000 +0200
+++ src/kernel/qapplication_x11.cpp 2007-05-29 16:24:58.000000000 +0200
@@ -201,6 +201,7 @@
static Display *appDpy = 0; // X11 application display
static char *appDpyName = 0; // X11 display name
static bool appForeignDpy = FALSE; // we didn't create display
+Q_EXPORT bool qt_no_foreign_hack = false;
static bool appSync = FALSE; // X11 synchronization
#if defined(QT_DEBUG)
static bool appNoGrab = FALSE; // X11 grabbing enabled
@@ -1639,7 +1640,7 @@
}
#endif
- if ( display ) {
+ if ( display && !qt_no_foreign_hack ) {
// Qt part of other application
appForeignDpy = TRUE;
@@ -1793,7 +1794,9 @@
// Connect to X server
if( qt_is_gui_used ) {
- if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) {
+ if( display != NULL && qt_no_foreign_hack )
+ appDpy = display;
+ else if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) {
qWarning( "%s: cannot connect to X server %s", appName,
XDisplayName(appDpyName) );
qApp = 0;
@@ -2439,6 +2442,10 @@
qt_init_internal( 0, 0, display, visual, colormap );
}
+void qt_init( int *argcptr, char **argv, Display *display, Qt::HANDLE visual, Qt::HANDLE colormap )
+{
+ qt_init_internal( argcptr, argv, display, visual, colormap );
+}
/*****************************************************************************
qt_cleanup() - cleans up when the application is finished
|