From 68cba853735b2d8a266367f47fe11040966ce85c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 23 Nov 2014 15:50:32 -0600 Subject: Fix twin deleting comptontdepidfile when compton-tde already running on startup Fix long-standing bug in calling desktop lock methods over DCOP from within kdesktop process --- tdmlib/dmctl.cpp | 16 +++++++++------- tdmlib/dmctl.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'tdmlib') diff --git a/tdmlib/dmctl.cpp b/tdmlib/dmctl.cpp index 6fea12b5a..cc9535ab4 100644 --- a/tdmlib/dmctl.cpp +++ b/tdmlib/dmctl.cpp @@ -393,15 +393,15 @@ void DM::lockSwitchVT( int vt ) { if (isSwitchable()) { - TQByteArray data; - TQCString replyType; - TQByteArray replyData; // Block here until lock is complete // If this is not done the desktop of the locked session will be shown after VT switch until the lock fully engages! - kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", data, replyType, replyData); - if (!switchVT( vt )) { - // Switching VT failed; unlock... - // kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "unlock()", data, replyType, replyData); + // Force remote call to ensure that blocking is enforced even if this call is being made from inside the "kdesktop" application... + // If this is not done DCOP will translate the call into a send and the desktop of the locked session will be shown after VT switch as above + if (system("dcop kdesktop KScreensaverIface lock") == 0) { + if (!switchVT( vt )) { + // Switching VT failed; unlock... + // system("dcop kdesktop KScreensaverIface unlock") + } } } } @@ -484,3 +484,5 @@ DM::type() } #endif // Q_WS_X11 + +#include "dmctl.moc" \ No newline at end of file diff --git a/tdmlib/dmctl.h b/tdmlib/dmctl.h index f50f72f6c..90928e2e3 100644 --- a/tdmlib/dmctl.h +++ b/tdmlib/dmctl.h @@ -32,10 +32,10 @@ struct SessEnt { typedef TQValueList SessList; class DM { - #ifdef Q_WS_X11 public: + DM(); ~DM(); -- cgit v1.2.3