From a67e2c7f07d64164ba1a74d0a2772ac6e676afa8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 6 Jul 2006 09:15:57 +0000 Subject: [PATCH] Register as org.kde.kwin (in addition to kapplication registering us as kwin_$PID) Not sure why this isn't a kuniqueapplication though (but klauncher is in the same situation anyway) svn path=/trunk/KDE/kdebase/workspace/; revision=558891 --- main.cpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/main.cpp b/main.cpp index 1fb4a33b12..a3a1c00727 100644 --- a/main.cpp +++ b/main.cpp @@ -29,8 +29,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "atoms.h" #include "options.h" #include "sm.h" -#include "utils.h" -#include "effects.h" #define INT8 _X11INT8 #define INT32 _X11INT32 @@ -95,7 +93,7 @@ Application::Application( ) } if (screen_number == -1) - screen_number = DefaultScreen(display()); + screen_number = DefaultScreen(QX11Info::display()); if( !owner.claim( args->isSet( "replace" ), true )) { @@ -113,14 +111,11 @@ Application::Application( ) XSetErrorHandler( x11ErrorHandler ); // check whether another windowmanager is running - XSelectInput(display(), rootWindow(), SubstructureRedirectMask ); + XSelectInput(QX11Info::display(), QX11Info::appRootWindow(), SubstructureRedirectMask ); syncX(); // trigger error now options = new Options; atoms = new Atoms; - effects = new EffectsHandler; - - initting = false; // TODO // create workspace. (void) new Workspace( isSessionRestored() ); @@ -133,29 +128,27 @@ Application::Application( ) ksplash.call( "upAndRunning", QString( "wm started" )); XEvent e; e.xclient.type = ClientMessage; - e.xclient.message_type = XInternAtom( display(), "_KDE_SPLASH_PROGRESS", False ); - e.xclient.display = display(); - e.xclient.window = rootWindow(); + e.xclient.message_type = XInternAtom( QX11Info::display(), "_KDE_SPLASH_PROGRESS", False ); + e.xclient.display = QX11Info::display(); + e.xclient.window = QX11Info::appRootWindow(); e.xclient.format = 8; strcpy( e.xclient.data.b, "wm started" ); - XSendEvent( display(), rootWindow(), False, SubstructureNotifyMask, &e ); + XSendEvent( QX11Info::display(), QX11Info::appRootWindow(), False, SubstructureNotifyMask, &e ); } Application::~Application() { delete Workspace::self(); if( owner.ownerWindow() != None ) // if there was no --replace (no new WM) - XSetInputFocus( display(), PointerRoot, RevertToPointerRoot, xTime() ); + XSetInputFocus( QX11Info::display(), PointerRoot, RevertToPointerRoot, QX11Info::appTime() ); delete options; - delete effects; - delete atoms; } void Application::lostSelection() { delete Workspace::self(); // remove windowmanager privileges - XSelectInput(display(), rootWindow(), PropertyChangeMask ); + XSelectInput(QX11Info::display(), QX11Info::appRootWindow(), PropertyChangeMask ); quit(); } @@ -279,13 +272,13 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) KWinInternal::SessionManaged weAreIndeed; KWinInternal::SessionSaveDoneHelper helper; - fcntl(XConnectionNumber(KWinInternal::display()), F_SETFD, 1); + fcntl(ConnectionNumber(QX11Info::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); QDBus::sessionBus().interface()->registerService( appname, QDBusConnectionInterface::DontQueueService );