more fixes; seeing as montel is playing around in kdebase i should get these in i suppose ;)

svn path=/trunk/KDE/kdebase/workspace/; revision=619144
icc-effect-5.14.5
Aaron J. Seigo 2007-01-02 21:02:22 +00:00
parent 32504fd22c
commit 2bc3c12849
3 changed files with 15 additions and 39 deletions

View File

@ -14,6 +14,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "main.h"
#include <kglobal.h>
#include <klocale.h>
#include <stdlib.h>
#include <kcmdlineargs.h>
@ -25,13 +26,12 @@ License. See the file "COPYING" for the exact licensing terms.
#include <stdio.h>
#include <fixx11h.h>
#include <QtDBus/QtDBus>
#include <kglobal.h>
#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 );

30
sm.cpp
View File

@ -11,6 +11,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "sm.h"
//#include <kdebug.h>
#include <unistd.h>
#include <stdlib.h>
#include <pwd.h>
@ -22,12 +23,11 @@ License. See the file "COPYING" for the exact licensing terms.
#include "client.h"
#include <QSocketNotifier>
#include <qsessionmanager.h>
#include <kdebug.h>
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 <appname>-mainwindow#<number>
// 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.

5
sm.h
View File

@ -15,6 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include <QDataStream>
#include <X11/SM/SMlib.h>
#include <kapplication.h>
#include <ksessionmanager.h>
#include <netwm_def.h>
class QSocketNotifier;
@ -77,8 +78,8 @@ class SessionSaveDoneHelper
};
class SessionManaged
: public KSessionManaged
class SessionManager
: public KSessionManager
{
public:
virtual bool saveState( QSessionManager& sm );