KStartupInfoData Class

Class representing data about an application startup notification. More...

Header: #include <KStartupInfo>
CMake: find_package(KF6 REQUIRED COMPONENTS KWindowSystem)
target_link_libraries(mytarget PRIVATE KF6::KWindowSystem)

Public Types

enum TriState { Yes, No, Unknown }

Public Functions

KStartupInfoData()
KStartupInfoData(const KStartupInfoData &data)
QByteArray WMClass() const
void addPid(pid_t pid)
(since 4.5) QString applicationId() const
const QString &bin() const
const QString &description() const
int desktop() const
const QString &findDescription() const
const QString &findIcon() const
const QString &findName() const
const QByteArray findWMClass() const
QByteArray hostname() const
const QString &icon() const
bool is_pid(pid_t pid) const
const QString &name() const
QList<pid_t> pids() const
int screen() const
(since 4.5) void setApplicationId(const QString &desktop)
void setBin(const QString &bin)
void setDescription(const QString &descr)
void setDesktop(int desktop)
void setHostname(const QByteArray &hostname = QByteArray())
void setIcon(const QString &icon)
void setName(const QString &name)
void setScreen(int screen)
void setSilent(KStartupInfoData::TriState state)
void setWMClass(const QByteArray &wmclass)
void setXinerama(int xinerama)
KStartupInfoData::TriState silent() const
void update(const KStartupInfoData &data)
int xinerama() const

Detailed Description

Such data include the icon of the starting application, the desktop on which the application should start, the binary name of the application, etc.

See also KStartupInfo and KStartupInfoId.

Member Type Documentation

enum KStartupInfoData::TriState

ConstantValue
KStartupInfoData::Yes0
KStartupInfoData::No1
KStartupInfoData::Unknown2

Member Function Documentation

KStartupInfoData::KStartupInfoData()

Constructor. Initializes all the data to their default empty values.

KStartupInfoData::KStartupInfoData(const KStartupInfoData &data)

Copy constructor.

QByteArray KStartupInfoData::WMClass() const

Returns the WM_CLASS value for the startup notification, or empty if not available.

See also setWMClass().

void KStartupInfoData::addPid(pid_t pid)

Adds a PID pid to the list of processes that belong to the startup notification.

It may be used to increase the chance that the windows created by the starting application will be detected correctly, and also for detecting if the application has quit without creating any window.

[since 4.5] QString KStartupInfoData::applicationId() const

The .desktop file used to initiate this startup notification, or empty.

This information should be used only to identify the application, not to read any additional information.

This function was introduced in 4.5.

See also setApplicationId().

const QString &KStartupInfoData::bin() const

Returns the binary name of the starting application.

See also setBin().

const QString &KStartupInfoData::description() const

Returns the name of the startup notification, or an empty string if not set.

See also setDescription().

int KStartupInfoData::desktop() const

Returns the desktop for the startup notification.

See also setDesktop().

const QString &KStartupInfoData::findDescription() const

Returns the description of the startup notification.

If it's not available, it returns name().

const QString &KStartupInfoData::findIcon() const

Returns the icon of the startup notification, and if it's not available, tries to get it from the binary name.

const QString &KStartupInfoData::findName() const

Returns the name of the startup notification.

If it's not available, it tries to use other information (binary name).

const QByteArray KStartupInfoData::findWMClass() const

Returns the WM_CLASS value for the startup notification, or binary name if not available.

QByteArray KStartupInfoData::hostname() const

Returns the hostname for the startup notification.

See also setHostname().

const QString &KStartupInfoData::icon() const

Returns the name of the startup notification icon, or an empty string if not set.

See also setIcon().

bool KStartupInfoData::is_pid(pid_t pid) const

Returns true if the given pid is in the list of PIDs for the startup notification

const QString &KStartupInfoData::name() const

Returns the name of the startup notification, or an empty string if not set.

See also setName().

QList<pid_t> KStartupInfoData::pids() const

Returns all PIDs for the startup notification.

int KStartupInfoData::screen() const

The X11 screen on which the startup notification is happening, -1 if unknown.

See also setScreen().

[since 4.5] void KStartupInfoData::setApplicationId(const QString &desktop)

Sets the desktop file that was used to initiate the startup notification.

This function was introduced in 4.5.

See also applicationId().

void KStartupInfoData::setBin(const QString &bin)

Sets the binary name bin of the application (e.g. 'kcontrol').

See also bin().

void KStartupInfoData::setDescription(const QString &descr)

Sets the description descr for the notification (e.g. 'Launching Control Center').

That is, name() describes what is being started, while description() is the actual action performed by the starting.

See also description().

void KStartupInfoData::setDesktop(int desktop)

Sets the desktop for the startup notification (i.e. the desktop on which the starting application should appear).

See also desktop().

void KStartupInfoData::setHostname(const QByteArray &hostname = QByteArray())

Sets the hostname on which the application is starting.

It's necessary to set it if PIDs are set. If it's a null string, the current hostname is used.

See also hostname().

void KStartupInfoData::setIcon(const QString &icon)

Sets the icon for the startup notification (e.g. 'kcontrol').

See also icon().

void KStartupInfoData::setName(const QString &name)

Sets the name for the notification (e.g. 'Control Center').

See also name().

void KStartupInfoData::setScreen(int screen)

Sets the X11 screen on which the startup notification should happen.

This is usually not necessary to set, as it's set by default to QX11Info::screen().

See also screen().

void KStartupInfoData::setSilent(KStartupInfoData::TriState state)

Sets whether the visual feedback for this startup notification with the given state should be silenced (temporarily suspended).

See also silent().

void KStartupInfoData::setWMClass(const QByteArray &wmclass)

Sets a WM_CLASS value wmclass for the startup notification.

It may be used for increasing the chance that the windows created by the starting application will be detected correctly.

void KStartupInfoData::setXinerama(int xinerama)

Sets the xinerama screen for the startup notification (i.e. the screeen on which the starting application should appear).

See also xinerama().

KStartupInfoData::TriState KStartupInfoData::silent() const

Returns KStartupInfoData::Yes if visual feedback for the startup notification is silenced.

See also setSilent().

void KStartupInfoData::update(const KStartupInfoData &data)

Updates the notification data from the given data.

Some data, such as the desktop or the name, won't be rewritten if already set.

int KStartupInfoData::xinerama() const

The Xinerama screen for the startup notification, -1 if unknown.

See also setXinerama().