summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kdeui/kdialog.cpp19
-rw-r--r--kdeui/kdialog.h2
2 files changed, 20 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)
diff --git a/kdeui/kdialog.h b/kdeui/kdialog.h
index f26e82f41..274ce8b33 100644
--- a/kdeui/kdialog.h
+++ b/kdeui/kdialog.h
@@ -247,9 +247,11 @@ public:
void closeSMDialog();
protected slots:
+ void keepMeOnTop();
void closeEvent(TQCloseEvent *e);
private:
+ TQTimer* m_keepOnTopTimer;
TQLabel* m_statusLabel;
bool m_allowClose;
};