[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kleopatra/uiserver
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2008-01-31 18:06:29
Message-ID: 1201802789.261141.19003.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 769159 by osterfeld:

bring dialogs to foreground/associate them with the client application if possible

 M  +12 -6     assuanserverconnection.cpp  


--- trunk/KDE/kdepim/kleopatra/uiserver/assuanserverconnection.cpp #769158:769159
@@ -53,7 +53,8 @@
 
 #include <kmime/kmime_header_parsing.h>
 
-#include <KLocale>
+#include <KLocalizedString>
+#include <KWindowSystem>
 
 #include <QSocketNotifier>
 #include <QVariant>
@@ -1163,12 +1164,17 @@
     }
     if ( QWidget * pw = QWidget::find( wid ) )
         dlg->setParent( pw );
-#ifdef Q_WS_X11
-    else if ( wid )
-        XSetTransientForHint( QX11Info::display(), dlg->winId(), wid );
+    else {    	
+#ifdef Q_WS_WIN
+    	//On Windows, setMainWindow isn't implemented (maybe can't),
+    	//we try to bring the window to foreground instead
+    	KWindowSystem::forceActiveWindow( dlg->winId() );
+#else
+    	//with other platforms, try to associate widget with the calling application
+    	if ( wid )
+    		KWindowSystem::setMainWindow( dlg->winId(), wid );
 #endif
-    else
-        qDebug() << "QWidget::find(" << wid << ") returned NULL - ignoring";
+    }
 }
 
 static QString commonPrefix( const QString & s1, const QString & s2 ) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic