summaryrefslogtreecommitdiffstats
path: root/src/tdedocker.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-03-26 15:10:12 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-03-26 15:10:12 +0900
commit88fbf7e81a6ab317262bd97875a0296f59287586 (patch)
tree0effe4e64f5cdf3c0aa42e8ca8096cca8b6ddc89 /src/tdedocker.cpp
parent5c2a45303ead893a78c69ddbef21d5acedf654ff (diff)
downloadtdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.tar.gz
tdedocker-88fbf7e81a6ab317262bd97875a0296f59287586.zip
1) Additional work on tq app -> tde app translation.
2) Make sure to exit app after restore if no app window can be grabbed 3) Save state only for known applications (app with empty name will not be saved and restored) Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/tdedocker.cpp')
-rw-r--r--src/tdedocker.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/tdedocker.cpp b/src/tdedocker.cpp
index 2b24cf5..8021e67 100644
--- a/src/tdedocker.cpp
+++ b/src/tdedocker.cpp
@@ -23,7 +23,6 @@
#include <tqfile.h>
#include <tqtextcodec.h>
#include <tqtextstream.h>
-#include <tqtimer.h>
#include <tqstring.h>
#include <tdecmdlineargs.h>
@@ -43,7 +42,21 @@
#define TMPFILE_PREFIX TQString("/tmp/tdedocker.")
TDEDocker::TDEDocker()
- : TDEApplication(), mTrayLabelMgr(NULL), firstSaveState(true)
+ : TDEApplication(), mTrayLabelMgr(NULL)
+{
+ // Set ourselves up to be called from the application loop
+ connect(&mInitTimer, SIGNAL(timeout()), this, SLOT(doInit()));
+ mInitTimer.start(0, true);
+
+ // Required so that the saved config is correctly loaded
+ // (see TrayLabelMgr::doRestoreSession() for usage)
+ if (TDEApplication::kApplication()->isRestored())
+ {
+ TDEApplication::kApplication()->sessionConfig();
+ }
+}
+
+void TDEDocker::doInit()
{
INIT_TRACE();
/*
@@ -58,12 +71,6 @@ TDEDocker::TDEDocker()
if (prev_instance == None)
{
- if (TDEApplication::kApplication()->isRestored())
- {
- // Required so that the saved config is correctly loaded
- // (see TrayLabelMgr::doRestoreSession() for usage)
- TDEApplication::kApplication()->sessionConfig();
- }
mSelectionOwner = XCreateSimpleWindow(display, tqt_xrootwin(), 1, 1, 1, 1, 1, 1, 1);
XSetSelectionOwner(display, tdedocker, mSelectionOwner, CurrentTime);
TRACE("Selection owner set to 0x%x", (unsigned) mSelectionOwner);
@@ -118,7 +125,7 @@ void TDEDocker::notifyPreviousInstance(Window prevInstance)
XSendEvent(display, prevInstance, False, 0, (XEvent *) &dock_event);
XSync(display, False);
- ::exit(0);
+ quit();
}
/*