Alt-F2 and different background on multiple desktops problems. (fwd)
---------- Forwarded message ----------
Date: Sun, 26 Nov 2000 12:21:26 +0000 (GMT)
From: Bart Oldeman <enbeo@enbeo.resnet.bris.ac.uk>
To: debian-kde@debian.org, y-masaki@kde.gr.jp, 77578@bugs.debian.org
(made a mistake in the e-mail address)
Hello,
after a search, and some trying, the patch
http://www.kde.gr.jp/patch/qt-2.2.2-xim-20001125.diff
(fix an XIM creation)
or the 1116 version, it does not matter,
causes the erronic Alt-F2 behaviour. It also causes the problem that all
desktops get the same background after executing a program, no matter
whether you set different backgrounds for different desktops.
The following part is what exactly causes this. I'm not familiar enough
with Qt to understand why, since I don't even know what an XIM is, but it
surely looks a bit drastic to me to comment out a piece of code and place
it somewhere else where the relationship between the functions is not that
obvious.
Bart
@@ -1047,6 +1078,17 @@
#endif
}
+void qt_create_xim()
+{
+#ifdef USE_X11R6_XIM
+ XRegisterIMInstantiateCallback( appDpy, 0 , 0, 0,
+ (XIMProc)QApplication::create_xim,
+ 0);
+#else
+ QApplication::create_xim();
+#endif
+}
+
void qt_init_internal( int *argcptr, char **argv, Display *display )
{
if ( display ) {
@@ -1320,15 +1369,19 @@
XSetLocaleModifiers (ximServerName.ascii()) == 0 )
qWarning( "Qt: Cannot set locale modifiers: %s",
ximServerName.ascii());
+ else if ( XSetLocaleModifiers ("") == 0 )
+ qWarning("Qt: Cannot set locale modifiers");
else if ( !noxim )
+/*
XRegisterIMInstantiateCallback( appDpy, 0 , 0, 0,
(XIMProc)QApplication::create_xim,
0);
+*/;
#else
else if ( XSetLocaleModifiers ("") == 0 )
qWarning("Qt: Cannot set locale modifiers");
else if ( !noxim )
- QApplication::create_xim();
+ ;//QApplication::create_xim();
#endif
#endif
@@ -638,6 +644,36 @@
#ifndef NO_XIM
if ( text ) {
QWidget* tlw = topLevelWidget();
+ if ( !qt_xim ) qt_create_xim();
+ if ( qt_xim && tlw->extra && tlw->extra->topextra &&
!tlw->extra->topextra->xic ) {
+ XPoint spot; spot.x = 1; spot.y = 1; // dummmy
+
+#ifndef QT_UNICODE
+ XFontSet fontset = xic_fontset( fontMetrics().fontSet(),
+ font().pointSize());
+#else
+ XFontSet fontset = create_fontset(font());
+#endif
+
+ XVaNestedList preedit_att = XVaCreateNestedList(0,
+ XNSpotLocation, &spot,
+ XNFontSet, fontset,
+ NULL);
+ XVaNestedList status_att = XVaCreateNestedList(0,
+ XNFontSet, fontset,
+ NULL);
+
+ tlw->extra->topextra->xic = (void*)XCreateIC( qt_xim,
+ XNInputStyle, qt_xim_style,
+ XNClientWindow, tlw->winId(),
+ XNFocusWindow, tlw->winId(),
+ XNPreeditAttributes, preedit_att,
+ XNStatusAttributes, status_att,
+ 0 );
+
+ XFree(preedit_att);
+ XFree(status_att);
+ }
if ( tlw->extra && tlw->extra->topextra &&
tlw->extra->topextra->xic ) {
QPoint p( x, y ); // ### use mapTo()
@@ -2095,6 +2135,7 @@
void QWidget::createTLSysExtra()
{
#ifndef NO_XIM
+/*
if ( qt_xim ) {
XPoint spot; spot.x = 1; spot.y = 1; // dummmy
@@ -2120,6 +2161,7 @@
XFree(status_att);
} else {
+*/ {
extra->topextra->xic = 0;
}
#else
Reply to: