Bug 174301 - multiple idle dialog boxes
Summary: multiple idle dialog boxes
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: Git (master)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Thorsten Staerk
URL:
Keywords:
: 84510 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-04 23:01 UTC by Bryan Larsen
Modified: 2008-12-23 12:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Larsen 2008-11-04 23:01:00 UTC
Version:           4.0.0 (using 4.1.2 (KDE 4.1.2), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.27-7-generic

To reproduce:

"Detect desktop as idle after:" set to 1 minute (just to make this test easier).

Three tasks defined, each of which are set to auto track the corresponding virtual desktop.  KTaskTimer is running on desktop 1.

- switch to desktop 2
- idle for a couple of minutes
- switch to desktop 3
- idle for a couple of minutes
- return to desktop 1

On desktop 1 you will find two idle dialog boxes.
Comment 1 Thorsten Staerk 2008-11-16 11:05:55 UTC
Confirmed - I have no idea how to put a message on the active virtual desktop. That is the sense of a virtual desktop, that not every application can access every virtual desktop.
Comment 3 Thorsten Staerk 2008-12-23 11:06:13 UTC
This is the perfect fix for the bug, the only failing is that it does not work:

Index: idletimedetector.cpp
===================================================================
--- idletimedetector.cpp        (revision 900452)
+++ idletimedetector.cpp        (working copy)
@@ -33,6 +33,7 @@
 #include <KLocale>    // i18n

 #include <kdebug.h>
+#include <KWindowSystem>

 #ifdef Q_WS_X11
 #include <QX11Info>
@@ -124,6 +125,7 @@
     dialog->setButtonWhatsThis(KDialog::Ok, explanation);
     dialog->setButtonWhatsThis(KDialog::Cancel, explanationrevert);
     dialog->show();
+    KWindowSystem::self()->setOnDesktop( wid->winId(), KWindowSystem::self()->currentDesktop() );
 }
 #endif // HAVE_LIBXSS
Comment 4 Thorsten Staerk 2008-12-23 11:24:42 UTC
WOHOOT@!

This worx now:
Index: idletimedetector.cpp
===================================================================
--- idletimedetector.cpp        (revision 900452)
+++ idletimedetector.cpp        (working copy)
@@ -33,6 +33,7 @@
 #include <KLocale>    // i18n

 #include <kdebug.h>
+#include <KWindowSystem>

 #ifdef Q_WS_X11
 #include <QX11Info>
@@ -123,6 +124,10 @@
     dialog->setButtonText(KDialog::Cancel, i18n("Revert timing"));
     dialog->setButtonWhatsThis(KDialog::Ok, explanation);
     dialog->setButtonWhatsThis(KDialog::Cancel, explanationrevert);
+    KWindowSystem::self()->setOnDesktop( dialog->winId(), KWindowSystem::self()->currentDesktop() );
+    KWindowSystem::self()->demandAttention( dialog->winId() );
+    kDebug(5970) << "******************************************************************";
+    kDebug(5970) << "Setting winId " << dialog->winId() << " to deskTop " << KWindowSystem::self()->currentDesktop();
     dialog->show();
 }
 #endif // HAVE_LIBXSS
Comment 5 Thorsten Staerk 2008-12-23 11:33:35 UTC
SVN commit 900568 by tstaerk:

Pop up the idle time detector on the desktop the user is actually
looking at.
BUGS:174301


 M  +5 -0      idletimedetector.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=900568
Comment 6 Thorsten Staerk 2008-12-23 12:34:02 UTC
*** Bug 84510 has been marked as a duplicate of this bug. ***