KWayland::Client::OutputConfiguration
#include <outputconfiguration.h>

Signals | |
void | applied () |
void | failed () |
Public Member Functions | |
void | apply () |
void | destroy () |
EventQueue * | eventQueue () |
bool | isValid () const |
operator org_kde_kwin_outputconfiguration * () | |
operator org_kde_kwin_outputconfiguration * () const | |
void | release () |
void | setColorCurves (OutputDevice *outputdevice, QVector< quint16 > red, QVector< quint16 > green, QVector< quint16 > blue) |
void | setEnabled (OutputDevice *outputdevice, OutputDevice::Enablement enable) |
void | setEventQueue (EventQueue *queue) |
void | setMode (OutputDevice *outputdevice, const int modeId) |
void | setOverscan (OutputDevice *outputdevice, uint32_t overscan) |
void | setPosition (OutputDevice *outputdevice, const QPoint &pos) |
void | setScale (OutputDevice *outputdevice, qint32 scale) |
void | setScaleF (OutputDevice *outputdevice, qreal scale) |
void | setTransform (OutputDevice *outputdevice, KWayland::Client::OutputDevice::Transform transform) |
void | setup (org_kde_kwin_outputconfiguration *outputconfiguration) |
void | setVrrPolicy (OutputDevice *outputdevice, OutputDevice::VrrPolicy policy) |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
![]() | |
objectName | |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
OutputConfiguration provides access to changing OutputDevices. The interface is async and atomic. An OutputConfiguration is created through OutputManagement::createConfiguration().
The overall mechanism is to get a new OutputConfiguration from the OutputManagement global and apply changes through the OutputConfiguration::set* calls. When all changes are set, the client calls apply, which asks the server to look at the changes and apply them. The server will then signal back whether the changes have been applied successfully (applied()
) or were rejected or failed to apply (failed()
).
The current settings for outputdevices can be gotten from Registry::outputDevices()
, these are used in the set* calls to identify the output the setting applies to.
These KWayland classes will not apply changes to the OutputDevices, this is the compositor's task. As such, the configuration set through this interface can be seen as a hint what the compositor should set up, but whether or not the compositor does it (based on hardware or rendering policies, for example), is up to the compositor. The mode setting is passed on to the DRM subsystem through the compositor. The compositor also saves this configuration and reads it on startup, this interface is not involved in that process.
apply()
should only be called after changes to all output devices have been made, not after each change. This allows to test the new configuration as a whole, and is a lot faster since hardware changes can be tested in their new combination, they done in parallel.and rolled back as a whole.
// We're just picking the first of our outputdevices KWayland::Client::OutputDevice *output = m_clientOutputs.first(); // Create a new configuration object auto config = m_outputManagement.createConfiguration(); // handle applied and failed signals connect(config, &OutputConfiguration::applied, []() { qDebug() << "Configuration applied!"; }); connect(config, &OutputConfiguration::failed, []() { qDebug() << "Configuration failed!"; }); // Change settings config->setMode(output, m_clientOutputs.first()->modes().last().id); config->setTransform(output, OutputDevice::Transform::Normal); config->setPosition(output, QPoint(0, 1920)); config->setScale(output, 2); // Now ask the compositor to apply the changes config->apply(); // You may wait for the applied() or failed() signal here
- See also
- OutputDevice
- OutputManagement
- OutputManagement::createConfiguration()
- Since
- 5.5
Definition at line 82 of file outputconfiguration.h.
Member Function Documentation
◆ applied
|
signal |
The server has applied all settings successfully.
Pending changes in the OutputDevices have been cleared, changed signals from the OutputDevice have been emitted.
◆ apply()
void KWayland::Client::OutputConfiguration::apply | ( | ) |
Ask the compositor to apply the changes.
This results in the compositor looking at all outputdevices and if they have pending changes from the set* calls, these changes will be tested with the hardware and applied if possible. The compositor will react to these changes with the applied() or failed() signals. Note that mode setting may take a while, so the interval between calling apply() and receiving the applied() signal may be considerable, depending on the hardware.
Definition at line 206 of file outputconfiguration.cpp.
◆ destroy()
void KWayland::Client::OutputConfiguration::destroy | ( | ) |
Destroys the data held by this OutputConfiguration.
This method is supposed to be used when the connection to the Wayland server goes away. If the connection is not valid any more, it's not possible to call release any more as that calls into the Wayland connection and the call would fail. This method cleans up the data, so that the instance can be deleted or setup to a new org_kde_kwin_outputconfiguration interface once there is a new connection available.
This method is automatically invoked when the Registry which created this OutputConfiguration gets destroyed.
- See also
- release
Definition at line 66 of file outputconfiguration.cpp.
◆ eventQueue()
EventQueue * KWayland::Client::OutputConfiguration::eventQueue | ( | ) |
- Returns
- The event queue to use for creating a OutputConfiguration
Definition at line 76 of file outputconfiguration.cpp.
◆ failed
|
signal |
The server has failed to apply the settings or rejected them.
Pending changes in the * OutputDevices have been cleared. No changes have been applied to the OutputDevices.
◆ isValid()
bool KWayland::Client::OutputConfiguration::isValid | ( | ) | const |
- Returns
true
if managing a org_kde_kwin_outputconfiguration.
Definition at line 91 of file outputconfiguration.cpp.
◆ release()
void KWayland::Client::OutputConfiguration::release | ( | ) |
Releases the org_kde_kwin_outputconfiguration interface.
After the interface has been released the OutputConfiguration instance is no longer valid and can be setup with another org_kde_kwin_outputconfiguration interface.
Definition at line 61 of file outputconfiguration.cpp.
◆ setEnabled()
void KWayland::Client::OutputConfiguration::setEnabled | ( | OutputDevice * | outputdevice, |
OutputDevice::Enablement | enable | ||
) |
Enable or disable an output.
Enabled means it's used by the compositor for rendering, Disabled means, that no wl_output is connected to this, and the device is sitting there unused by this compositor. The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
outputdevice the OutputDevice this change applies to. enable new Enablement state of this output device.
Definition at line 98 of file outputconfiguration.cpp.
◆ setEventQueue()
void KWayland::Client::OutputConfiguration::setEventQueue | ( | EventQueue * | queue | ) |
Sets the queue
to use for creating a OutputConfiguration.
Definition at line 71 of file outputconfiguration.cpp.
◆ setMode()
void KWayland::Client::OutputConfiguration::setMode | ( | OutputDevice * | outputdevice, |
const int | modeId | ||
) |
Set the mode of this output, identified by its mode id.
The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
outputdevice the OutputDevice this change applies to. modeId the id of the mode.
Definition at line 108 of file outputconfiguration.cpp.
◆ setOverscan()
void KWayland::Client::OutputConfiguration::setOverscan | ( | OutputDevice * | outputdevice, |
uint32_t | overscan | ||
) |
Set overscan in % for this output.
- Since
- 5.82
Definition at line 190 of file outputconfiguration.cpp.
◆ setPosition()
void KWayland::Client::OutputConfiguration::setPosition | ( | OutputDevice * | outputdevice, |
const QPoint & | pos | ||
) |
Position this output in the global space, relative to other outputs.
QPoint(0, 0) for top-left. The position is the top-left corner of this output. There may not be gaps between outputs, they have to be positioned adjacent to each other. The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
outputdevice the OutputDevice this change applies to. pos the OutputDevice global position relative to other outputs,
Definition at line 142 of file outputconfiguration.cpp.
◆ setScale()
void KWayland::Client::OutputConfiguration::setScale | ( | OutputDevice * | outputdevice, |
qint32 | scale | ||
) |
Scale rendering of this output.
The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
scale the scaling factor for this output device. outputdevice the OutputDevice this change applies to.
- Deprecated:
- Since 5.50, use setScaleF(OutputDevice *, qreal)
Definition at line 149 of file outputconfiguration.cpp.
◆ setScaleF()
void KWayland::Client::OutputConfiguration::setScaleF | ( | OutputDevice * | outputdevice, |
qreal | scale | ||
) |
Scale rendering of this output.
The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
scale the scaling factor for this output device. outputdevice the OutputDevice this change applies to.
- Since
- 5.50
Definition at line 155 of file outputconfiguration.cpp.
◆ setTransform()
void KWayland::Client::OutputConfiguration::setTransform | ( | OutputDevice * | outputdevice, |
KWayland::Client::OutputDevice::Transform | transform | ||
) |
Set transformation for this output, for example rotated or flipped.
The changes done in this call will be recorded in the OutputDevice and only applied after apply() has been called.
- Parameters
-
outputdevice the OutputDevice this change applies to. scale the scaling factor for this output device.
Definition at line 114 of file outputconfiguration.cpp.
◆ setup()
void KWayland::Client::OutputConfiguration::setup | ( | org_kde_kwin_outputconfiguration * | outputconfiguration | ) |
Setup this OutputConfiguration to manage the outputconfiguration
.
When using OutputManagement::createOutputConfiguration there is no need to call this method.
- Parameters
-
outputconfiguration the outputconfiguration object to set up.
Definition at line 48 of file outputconfiguration.cpp.
◆ setVrrPolicy()
void KWayland::Client::OutputConfiguration::setVrrPolicy | ( | OutputDevice * | outputdevice, |
OutputDevice::VrrPolicy | policy | ||
) |
Set the VRR policy for this output.
- Since
- 5.82
Definition at line 198 of file outputconfiguration.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:50:02 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.