summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-03-25 12:20:16 +0100
committerLuboš Luňák <l.lunak@collabora.com>2014-03-25 12:23:02 +0100
commit71f2aff7a56cef4e133abad3c2e447c76c5ee1fe (patch)
tree89f85fc75db61adefd9b97e638fe1d69a2dd6a5c /vcl
parentdd52330db6551c3e96fce5ba17ff823882d158fd (diff)
prevent KDE/Qt from interfering with the session manager
I occassionally get lockups in IceProcessMessages() called from QtCore, I'm actually not exactly sure why, as theoretically two connections from one app shouldn't be a problem, but since LO does its own session handling, there's no need to the KDE/Qt code to be involved, so prevent it from connecting to the session manager altogether. Change-Id: Iebe20d4cb5403e5fea8bd5d8c1f69b62d1c2907b
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx17
-rw-r--r--vcl/unx/kde4/VCLKDEApplication.hxx8
2 files changed, 16 insertions, 9 deletions
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 820d39aa661e..e4900a719408 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -166,8 +166,23 @@ void KDEXLib::Init()
KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
+ // LO does its own session management, so prevent KDE/Qt from interfering
+ // (QApplication::disableSessionManagement(false) wouldn't quite do,
+ // since that still actually connects to the session manager, it just
+ // won't save the application data on session shutdown).
+ char* session_manager = NULL;
+ if( getenv( "SESSION_MANAGER" ) != NULL )
+ {
+ session_manager = strdup( getenv( "SESSION_MANAGER" ));
+ unsetenv( "SESSION_MANAGER" );
+ }
m_pApplication = new VCLKDEApplication();
- kapp->disableSessionManagement();
+ if( session_manager != NULL )
+ {
+ setenv( "SESSION_MANAGER", session_manager, 1 );
+ free( session_manager );
+ }
+
KApplication::setQuitOnLastWindowClosed(false);
#if KDE_HAVE_GLIB
diff --git a/vcl/unx/kde4/VCLKDEApplication.hxx b/vcl/unx/kde4/VCLKDEApplication.hxx
index 412ee3483678..4ce0b2ca4f67 100644
--- a/vcl/unx/kde4/VCLKDEApplication.hxx
+++ b/vcl/unx/kde4/VCLKDEApplication.hxx
@@ -21,22 +21,14 @@
#define Region QtXRegion
-#include <QSessionManager>
-
#include <kapplication.h>
#undef Region
-/* #i59042# override KApplications method for session management
- * since it will interfere badly with our own.
- */
class VCLKDEApplication : public KApplication
{
public:
VCLKDEApplication();
-
- virtual void commitData(QSessionManager&) {};
-
virtual bool x11EventFilter(XEvent* event);
};