--- kdecore/kstartupinfo.cpp.sav 2005-11-30 16:54:00.000000000 +0100 +++ kdecore/kstartupinfo.cpp 2006-06-02 17:16:50.000000000 +0200 @@ -1105,7 +1105,7 @@ unsigned long KStartupInfoId::timestamp( struct KStartupInfoDataPrivate { KStartupInfoDataPrivate() : desktop( 0 ), wmclass( "" ), hostname( "" ), - silent( KStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ) {}; + silent( KStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ), xinerama( -1 ), launched_by( 0 ) {}; QString bin; QString name; QString description; @@ -1117,6 +1117,8 @@ struct KStartupInfoDataPrivate KStartupInfoData::TriState silent; unsigned long timestamp; int screen; + int xinerama; + WId launched_by; }; QString KStartupInfoData::to_text() const @@ -1147,6 +1149,10 @@ QString KStartupInfoData::to_text() cons ret += QString::fromLatin1( " TIMESTAMP=%1" ).arg( d->timestamp ); if( d->screen != -1 ) ret += QString::fromLatin1( " SCREEN=%1" ).arg( d->screen ); + if( d->xinerama != -1 ) + ret += QString::fromLatin1( " XINERAMA=%1" ).arg( d->xinerama ); + if( d->launched_by != 0 ) + ret += QString::fromLatin1( " LAUNCHED_BY=%1" ).arg( d->launched_by ); return ret; } @@ -1165,6 +1171,8 @@ KStartupInfoData::KStartupInfoData( cons const QString silent_str = QString::fromLatin1( "SILENT=" ); const QString timestamp_str = QString::fromLatin1( "TIMESTAMP=" ); const QString screen_str = QString::fromLatin1( "SCREEN=" ); + const QString xinerama_str = QString::fromLatin1( "XINERAMA=" ); + const QString launched_by_str = QString::fromLatin1( "LAUNCHED_BY=" ); for( QStringList::Iterator it = items.begin(); it != items.end(); ++it ) @@ -1195,6 +1203,10 @@ KStartupInfoData::KStartupInfoData( cons d->timestamp = get_unum( *it ); else if( ( *it ).startsWith( screen_str )) d->screen = get_num( *it ); + else if( ( *it ).startsWith( xinerama_str )) + d->xinerama = get_num( *it ); + else if( ( *it ).startsWith( launched_by_str )) + d->launched_by = get_num( *it ); } } @@ -1238,6 +1250,10 @@ void KStartupInfoData::update( const KSt d->timestamp = data_P.timestamp(); if( data_P.screen() != -1 ) d->screen = data_P.screen(); + if( data_P.xinerama() != -1 && xinerama() != -1 ) // don't overwrite + d->xinerama = data_P.xinerama(); + if( data_P.launchedBy() != 0 && launchedBy() != 0 ) // don't overwrite + d->launched_by = data_P.launchedBy(); } KStartupInfoData::KStartupInfoData() @@ -1408,6 +1424,26 @@ int KStartupInfoData::screen() const return d->screen; } +void KStartupInfoData::setXinerama( int xinerama ) + { + d->xinerama = xinerama; + } + +int KStartupInfoData::xinerama() const + { + return d->xinerama; + } + +void KStartupInfoData::setLaunchedBy( WId window ) + { + d->launched_by = window; + } + +WId KStartupInfoData::launchedBy() const + { + return d->launched_by; + } + static long get_num( const QString& item_P ) { --- kdecore/kstartupinfo.h.sav 2005-05-04 13:02:22.000000000 +0200 +++ kdecore/kstartupinfo.h 2006-06-02 17:13:45.000000000 +0200 @@ -635,6 +635,30 @@ class KDECORE_EXPORT KStartupInfoData * This is usually not necessary to set, as it's set by default to qt_xscreen(). */ void setScreen( int screen ); + + /** + * The Xinerama screen for the startup notification, -1 if unknown. + */ + int xinerama() const; + + /** + * Sets the Xinerama screen for the startup notification ( i.e. the screeen on which + * the starting application should appear ). + * @param xinerama the Xinerama screen for the startup notification + */ + void setXinerama( int xinerama ); + + /** + * The toplevel window of the application that caused this startup notification, + * 0 if unknown. + */ + WId launchedBy() const; + + /** + * Sets the toplevel window of the application that caused this startup notification. + * @param window window ID of the toplevel window that is responsible for this startup + */ + void setLaunchedBy( WId window ); /** * Updates the notification data from the given data. Some data, such as the desktop