Plasma-workspace
xwindowtasksmodel.cpp
58 NET::WMState | NET::XAWMState | NET::WMDesktop | NET::WMVisibleName | NET::WMGeometry | NET::WMFrameExtents | NET::WMWindowType | NET::WMPid;
59static const NET::Properties2 windowInfoFlags2 = NET::WM2DesktopFileName | NET::WM2Activities | NET::WM2WindowClass | NET::WM2AllowedActions
156 for (const auto locations = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation); const QString &location : locations) {
175 QObject::connect(windowSystem, &XWindowSystemEventBatcher::windowRemoved, q, [this](WId window) {
179 QObject::connect(windowSystem, &XWindowSystemEventBatcher::windowChanged, q, [this](WId window, NET::Properties properties, NET::Properties2 properties2) {
209 // No need to do anything if the model is empty. This avoids calling q->dataChanged with an invalid QModelIndex.
216 Q_EMIT q->dataChanged(q->index(0, 0), q->index(q->rowCount() - 1, 0), QList<int>{StackingOrder});
234 KWindowInfo info(window, NET::WMWindowType | NET::WMState | NET::WMName | NET::WMVisibleName, NET::WM2TransientFor);
236 NET::WindowType wType = info.windowType(NET::NormalMask | NET::DesktopMask | NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask
237 | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask | NET::NotificationMask);
242 if (leader > 0 && leader != window && leader != X11Info::appRootWindow() && !transients.contains(window) && windows.contains(leader)) {
255 if (wType != NET::Normal && wType != NET::Override && wType != NET::Unknown && wType != NET::Dialog && wType != NET::Utility) {
296void XWindowTasksModel::Private::transientChanged(WId window, NET::Properties properties, NET::Properties2 properties2)
336void XWindowTasksModel::Private::windowChanged(WId window, NET::Properties properties, NET::Properties2 properties2)
348 if (properties & (NET::WMPid) || properties2 & (NET::WM2DesktopFileName | NET::WM2WindowClass)) {
351 changedRoles << Qt::DecorationRole << AppId << AppName << GenericName << LauncherUrl << AppPid << SkipTaskbar << CanLaunchNewInstance;
498 icon.addPixmap(KX11Extras::icon(window, KIconLoader::SizeSmall, KIconLoader::SizeSmall, false));
499 icon.addPixmap(KX11Extras::icon(window, KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium, false));
500 icon.addPixmap(KX11Extras::icon(window, KIconLoader::SizeMedium, KIconLoader::SizeMedium, false));
501 icon.addPixmap(KX11Extras::icon(window, KIconLoader::SizeLarge, KIconLoader::SizeLarge, false));
553 return windowUrlFromMetadata(QString::fromLocal8Bit(info->windowClassClass()), info->pid(), rulesConfig, QString::fromLocal8Bit(info->windowClassName()));
596 uQuery.addQueryItem(QStringLiteral("iconData"), QString::fromLatin1(bytes.toBase64(QByteArray::Base64UrlEncoding)));
606 return ((windowInfo(window)->hasState(NET::DemandsAttention)) || transientsDemandingAttention.contains(window));
695 // The size belongs to the scaled coordinate system, which means the size is already divided by DPR
705 return (info->hasState(NET::SkipTaskbar) || info->windowType(NET::UtilityMask) == NET::Utility || d->appData(window).skipTaskbar);
795 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
816 ri.moveResizeRequest(window, geom.center().x(), geom.center().y(), NET::Move, XCB_BUTTON_INDEX_ANY);
821 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
842 ri.moveResizeRequest(window, geom.bottomRight().x(), geom.bottomRight().y(), NET::BottomRight, XCB_BUTTON_INDEX_ANY);
874 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
892 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::WMState, NET::Properties2());
907 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
914 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::WMState, NET::Properties2());
925 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
932 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::WMState, NET::Properties2());
943 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
950 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::WMState, NET::Properties2());
961 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
968 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::WMState, NET::Properties2());
977void XWindowTasksModel::requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops)
1040void XWindowTasksModel::requestActivities(const QModelIndex &index, const QStringList &activities)
1051void XWindowTasksModel::requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate)
1055 if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) {
1061 if (d->delegateGeometries.contains(window) && d->delegateGeometries.value(window) == geometry) {
1065 NETWinInfo ni(X11Info::connection(), window, X11Info::appRootWindow(), NET::Properties(), NET::Properties2());
static bool isDesktopFile(const QString &path)
void deleted(const QString &path)
void dirty(const QString &path)
void created(const QString &path)
SizeMedium
SizeSmallMedium
SizeSmall
SizeLarge
static Ptr serviceByStorageId(const QString &_storageId)
static KSycoca * self()
Q_SIGNAL void databaseChanged()
bool isMinimized() const
int pid() const
bool valid(bool withdrawn_is_valid=false) const
QByteArray gtkApplicationId() const
QByteArray windowClassName() const
bool isOnCurrentDesktop() const
bool hasState(NET::States s) const
QByteArray applicationMenuServiceName() const
bool onAllDesktops() const
QRect geometry() const
NET::WindowType windowType(NET::WindowTypes supported_types) const
QByteArray desktopFileName() const
int desktop() const
QByteArray windowClassClass() const
QByteArray applicationMenuObjectPath() const
static QPixmap icon(WId win, int width, int height, bool scale, int flags)
static void setOnAllDesktops(WId win, bool b)
void activeWindowChanged(WId id)
static void minimizeWindow(WId win)
static int currentDesktop()
static int numberOfDesktops()
static void setCurrentDesktop(int desktop)
static void unminimizeWindow(WId win)
static QList< WId > stackingOrder()
static WId activeWindow()
static Q_INVOKABLE void forceActiveWindow(QWindow *window, long time=0)
static QList< WId > windows()
static void setOnActivities(WId win, const QStringList &activities)
void stackingOrderChanged()
static void setOnDesktop(WId win, int desktop)
void moveResizeRequest(xcb_window_t window, int x_root, int y_root, Direction direction, xcb_button_t button=XCB_BUTTON_INDEX_ANY, RequestSource source=RequestSource::FromUnknown)
void closeWindowRequest(xcb_window_t window)
void setNumberOfDesktops(int numberOfDesktops)
void setState(NET::States state, NET::States mask)
void setIconGeometry(NETRect geometry)
MaxHoriz
Max
Shaded
MaxVert
DemandsAttention
SkipTaskbar
FullScreen
KeepAbove
Hidden
SkipPager
KeepBelow
DialogMask
MenuMask
SplashMask
UtilityMask
OverrideMask
ToolbarMask
DockMask
NormalMask
DesktopMask
TopMenuMask
NotificationMask
WindowType
Override
Normal
Unknown
Dialog
Utility
KCALUTILS_EXPORT QString mimeType()
QVariant location(const QVariant &res)
KGUIADDONS_EXPORT QWindow * window(QObject *job)
QCA_EXPORT void init()
Base64UrlEncoding
char * data()
qsizetype size() const const
QByteArray toBase64(Base64Options options) const const
QDateTime currentDateTime()
bool exists() const const
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
WriteOnly
bool contains(const AT &value) const const
qsizetype indexOf(const AT &value, qsizetype from) const const
bool isEmpty() const const
QByteArray data(const QString &mimeType) const const
virtual bool hasFormat(const QString &mimeType) const const
QVariant data(int role) const const
bool isValid() const const
const QAbstractItemModel * model() const const
int row() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool isNull() const const
bool save(QIODevice *device, const char *format, int quality) const const
int x() const const
int y() const const
QPoint bottomRight() const const
QPoint center() const const
int height() const const
bool isValid() const const
int width() const const
int x() const const
int y() const const
ConfigLocation
QStringList standardLocations(StandardLocation type)
QString & append(QChar ch)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromLatin1(QByteArrayView str)
QString fromLocal8Bit(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
DecorationRole
void timeout()
QUrl fromLocalFile(const QString &localFile)
bool isValid() const const
void setQuery(const QString &query, ParsingMode mode)
QString url(FormattingOptions options) const const
bool toBool() const const
int x
int y
NETPoint pos
NETSize size
int height
int width
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.