Use the new app startup info stuff to implement start_on_desktop.
svn path=/trunk/kdebase/kwin/; revision=98620
This commit is contained in:
parent
10672210ae
commit
322eaa8daa
2 changed files with 18 additions and 1 deletions
|
@ -20,6 +20,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
|
|||
#include <dcopclient.h>
|
||||
#include <kprocess.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kstartupinfo.h>
|
||||
|
||||
#include <netwm.h>
|
||||
|
||||
|
@ -90,6 +91,8 @@ class WorkspacePrivate
|
|||
{
|
||||
public:
|
||||
WorkspacePrivate() {};
|
||||
~WorkspacePrivate() {};
|
||||
KStartupInfo* startup;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -283,6 +286,9 @@ Workspace::Workspace( bool restore )
|
|||
Qt::WType_Desktop | Qt::WPaintUnclipped
|
||||
);
|
||||
|
||||
// call this before XSelectInput() on the root window
|
||||
d->startup = new KStartupInfo( false, this );
|
||||
|
||||
// select windowmanager privileges
|
||||
XSelectInput(qt_xdisplay(), root,
|
||||
KeyPressMask |
|
||||
|
@ -512,6 +518,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
|||
return destroyClient( findClient( e->xdestroywindow.window ) );
|
||||
case MapRequest:
|
||||
kwin_updateTime();
|
||||
checkStartOnDesktop( e->xmaprequest.window );
|
||||
c = findClient( e->xmaprequest.window );
|
||||
if ( !c ) {
|
||||
if ( e->xmaprequest.parent ) { // == root ) { //###TODO store rpeviously destroyed client ids
|
||||
|
@ -3731,5 +3738,14 @@ void Workspace::configureWM()
|
|||
KApplication::kdeinitExec( "kcmshell", args );
|
||||
}
|
||||
|
||||
|
||||
void Workspace::checkStartOnDesktop( WId w )
|
||||
{
|
||||
KStartupInfoData data;
|
||||
if( d->startup->checkStartup( w, data ) != KStartupInfo::Match || data.desktop() == 0 )
|
||||
return;
|
||||
NETWinInfo info( qt_xdisplay(), w, qt_xrootwin(), NET::WMDesktop );
|
||||
if( info.desktop() == 0 )
|
||||
info.setDesktop( data.desktop());
|
||||
}
|
||||
|
||||
#include "workspace.moc"
|
||||
|
|
|
@ -281,6 +281,7 @@ protected:
|
|||
bool keyRelease( XKeyEvent key );
|
||||
bool keyPressMouseEmulation( XKeyEvent key );
|
||||
bool netCheck( XEvent* e );
|
||||
void checkStartOnDesktop( WId w );
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
|
Loading…
Reference in a new issue