summaryrefslogtreecommitdiffstats
path: root/kdeui/kdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-08 05:21:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-08 05:21:48 +0000
commit47e6000a144cfedc244c0b1ff2580c6f90967451 (patch)
tree91baa65706634c43bd938650fbc94fa631ff32b7 /kdeui/kdialog.cpp
parent10868e2434cc7ca3be30630780a5a4b7b4cd0705 (diff)
downloadtdelibs-47e6000a144cfedc244c0b1ff2580c6f90967451.tar.gz
tdelibs-47e6000a144cfedc244c0b1ff2580c6f90967451.zip
Keep system modal dialogs on top of all other windows
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1257823 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kdialog.cpp')
-rw-r--r--kdeui/kdialog.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/kdeui/kdialog.cpp b/kdeui/kdialog.cpp
index b41c8c479..e9082b657 100644
--- a/kdeui/kdialog.cpp
+++ b/kdeui/kdialog.cpp
@@ -393,7 +393,7 @@ KSMModalDialogHeader::~KSMModalDialogHeader()
}
KSMModalDialog::KSMModalDialog(TQWidget* parent)
- : TQWidget( 0, "", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_allowClose(false)
+ : TQWidget( 0, "systemmodaldialogclass", Qt::WStyle_Customize | Qt::WType_Dialog | Qt::WStyle_Title | Qt::WStyle_StaysOnTop | Qt::WDestructiveClose ), m_keepOnTopTimer(NULL), m_allowClose(false)
{
// Signal that we do not want any window controls to be shown at all
@@ -431,10 +431,27 @@ KSMModalDialog::KSMModalDialog(TQWidget* parent)
TQSize sh = tqsizeHint();
TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
move(rect.x() + (rect.width() - sh.width())/2, rect.y() + (rect.height() - sh.height())/2);
+
+ show();
+ keepMeOnTop();
+}
+
+void KSMModalDialog::keepMeOnTop()
+{
+ if (!m_keepOnTopTimer) {
+ m_keepOnTopTimer = new TQTimer();
+ connect(m_keepOnTopTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(keepMeOnTop()));
+ m_keepOnTopTimer->start(100, FALSE);
+ }
+ setActiveWindow();
+ raise();
+ setFocus();
}
KSMModalDialog::~KSMModalDialog()
{
+ m_keepOnTopTimer->stop();
+ delete m_keepOnTopTimer;
}
void KSMModalDialog::setStatusMessage(TQString message)