diff --git a/main.cpp b/main.cpp index b9ac2aceb5..a4efb51a78 100644 --- a/main.cpp +++ b/main.cpp @@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms. #include "main.h" +#include #include #include #include @@ -25,13 +26,12 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include -#include +#include "ksplash_interface.h" #include "atoms.h" #include "options.h" #include "sm.h" #include "utils.h" -#include "effects.h" #define INT8 _X11INT8 #define INT32 _X11INT32 @@ -119,8 +119,6 @@ Application::Application( ) options = new Options; atoms = new Atoms; - - initting = false; // TODO // create workspace. (void) new Workspace( isSessionRestored() ); @@ -129,8 +127,9 @@ Application::Application( ) initting = false; // startup done, we are up and running now. - QDBusInterface ksplash( "org.kde.ksplash", "/ksplash", "org.kde.KSplash" ); - ksplash.call( "upAndRunning", QString( "wm started" )); + org::kde::KSplash ksplash("org.kde.ksplash", "/KSplash", QDBusConnection::sessionBus()); + ksplash.upAndRunning(QString( "wm started" )); + XEvent e; e.xclient.type = ClientMessage; e.xclient.message_type = XInternAtom( display(), "_KDE_SPLASH_PROGRESS", False ); @@ -147,8 +146,6 @@ Application::~Application() if( owner.ownerWindow() != None ) // if there was no --replace (no new WM) XSetInputFocus( display(), PointerRoot, RevertToPointerRoot, xTime() ); delete options; - delete effects; - delete atoms; } void Application::lostSelection() @@ -276,16 +273,16 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) // KApplication::disableAutoDcopRegistration(); #endif KWinInternal::Application a; - KWinInternal::SessionManaged weAreIndeed; + KWinInternal::SessionManager weAreIndeed; KWinInternal::SessionSaveDoneHelper helper; fcntl(XConnectionNumber(KWinInternal::display()), F_SETFD, 1); QString appname; if (KWinInternal::screen_number == 0) - appname = "kwin"; + appname = "org.kde.kwin"; else - appname.sprintf("kwin-screen-%d", KWinInternal::screen_number); + appname.sprintf("org.kde.kwin-screen-%d", KWinInternal::screen_number); QDBusConnection::sessionBus().interface()->registerService( appname, QDBusConnectionInterface::DontQueueService ); diff --git a/sm.cpp b/sm.cpp index 8ed87e5823..e5dbf6266f 100644 --- a/sm.cpp +++ b/sm.cpp @@ -11,6 +11,7 @@ License. See the file "COPYING" for the exact licensing terms. #include "sm.h" +//#include #include #include #include @@ -22,12 +23,11 @@ License. See the file "COPYING" for the exact licensing terms. #include "client.h" #include #include -#include namespace KWinInternal { -bool SessionManaged::saveState( QSessionManager& sm ) +bool SessionManager::saveState( QSessionManager& sm ) { // If the session manager is ksmserver, save stacking // order, active window, active desktop etc. in phase 1, @@ -53,7 +53,7 @@ bool SessionManaged::saveState( QSessionManager& sm ) } // I bet this is broken, just like everywhere else in KDE -bool SessionManaged::commitData( QSessionManager& sm ) +bool SessionManager::commitData( QSessionManager& sm ) { if ( !sm.isPhase2() ) Workspace::self()->sessionSaveStarted(); @@ -257,28 +257,6 @@ bool Workspace::sessionInfoWindowTypeMatch( Client* c, SessionInfo* info ) return info->windowType == c->windowType(); } -// maybe needed later -#if 0 -// KMainWindow's without name() given have WM_WINDOW_ROLE in the form -// of -mainwindow# -// when comparing them for fake session info, it's probably better to check -// them without the trailing number -bool Workspace::windowRoleMatch( const QByteArray& role1, const QByteArray& role2 ) - { - if( role1.isEmpty() && role2.isEmpty()) - return true; - int pos1 = role1.find( '#' ); - int pos2 = role2.find( '#' ); - bool ret; - if( pos1 < 0 || pos2 < 0 || pos1 != pos2 ) - ret = role1 == role2; - else - ret = qstrncmp( role1, role2, pos1 ) == 0; - kDebug() << "WR:" << role1 << ":" << pos1 << ":" << role2 << ":" << pos2 << ":::" << ret << endl; - return ret; - } -#endif - static const char* const window_type_names[] = { "Unknown", "Normal" , "Desktop", "Dock", "Toolbar", "Menu", "Dialog", @@ -312,7 +290,7 @@ NET::WindowType Workspace::txtToWindowType( const char* txt ) // KWin's focus stealing prevention causes problems with user interaction // during session save, as it prevents possible dialogs from getting focus. // Therefore it's temporarily disabled during session saving. Start of -// session saving can be detected in SessionManaged::saveState() above, +// session saving can be detected in SessionManager::saveState() above, // but Qt doesn't have API for saying when session saved finished (either // successfully, or was canceled). Therefore, create another connection // to session manager, that will provide this information. diff --git a/sm.h b/sm.h index efb63b49bf..3ca636ebf3 100644 --- a/sm.h +++ b/sm.h @@ -15,6 +15,7 @@ License. See the file "COPYING" for the exact licensing terms. #include #include #include +#include #include class QSocketNotifier; @@ -77,8 +78,8 @@ class SessionSaveDoneHelper }; -class SessionManaged - : public KSessionManaged +class SessionManager + : public KSessionManager { public: virtual bool saveState( QSessionManager& sm );