Drop Window.screen property
Use Window.output instead.
This commit is contained in:
parent
37f4199b19
commit
83c38b0907
9 changed files with 17 additions and 27 deletions
|
@ -499,7 +499,7 @@ void InternalWindow::commitGeometry(const QRectF &rect)
|
||||||
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
if (oldOutput != m_output) {
|
if (oldOutput != m_output) {
|
||||||
Q_EMIT screenChanged();
|
Q_EMIT outputChanged();
|
||||||
}
|
}
|
||||||
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,8 +458,9 @@ bool Rules::update(Window *c, int selection)
|
||||||
desktops = c->desktopIds();
|
desktops = c->desktopIds();
|
||||||
}
|
}
|
||||||
if NOW_REMEMBER (Screen, screen) {
|
if NOW_REMEMBER (Screen, screen) {
|
||||||
updated = updated || screen != c->screen();
|
const int index = workspace()->outputs().indexOf(c->output());
|
||||||
screen = c->screen();
|
updated = updated || screen != index;
|
||||||
|
screen = index;
|
||||||
}
|
}
|
||||||
if NOW_REMEMBER (Activity, activity) {
|
if NOW_REMEMBER (Activity, activity) {
|
||||||
updated = updated || activity != c->activities();
|
updated = updated || activity != c->activities();
|
||||||
|
|
|
@ -134,7 +134,7 @@ DecorationItem::DecorationItem(KDecoration2::Decoration *decoration, Window *win
|
||||||
this, &DecorationItem::handleFrameGeometryChanged);
|
this, &DecorationItem::handleFrameGeometryChanged);
|
||||||
connect(window, &Window::windowClosed,
|
connect(window, &Window::windowClosed,
|
||||||
this, &DecorationItem::handleWindowClosed);
|
this, &DecorationItem::handleWindowClosed);
|
||||||
connect(window, &Window::screenChanged,
|
connect(window, &Window::outputChanged,
|
||||||
this, &DecorationItem::handleOutputChanged);
|
this, &DecorationItem::handleOutputChanged);
|
||||||
|
|
||||||
connect(decoration, &KDecoration2::Decoration::bordersChanged,
|
connect(decoration, &KDecoration2::Decoration::bordersChanged,
|
||||||
|
|
|
@ -37,8 +37,8 @@ void ClientModel::setupClientConnections(Window *client)
|
||||||
connect(client, &Window::desktopChanged, this, [this, client]() {
|
connect(client, &Window::desktopChanged, this, [this, client]() {
|
||||||
markRoleChanged(client, DesktopRole);
|
markRoleChanged(client, DesktopRole);
|
||||||
});
|
});
|
||||||
connect(client, &Window::screenChanged, this, [this, client]() {
|
connect(client, &Window::outputChanged, this, [this, client]() {
|
||||||
markRoleChanged(client, ScreenRole);
|
markRoleChanged(client, OutputRole);
|
||||||
});
|
});
|
||||||
connect(client, &Window::activitiesChanged, this, [this, client]() {
|
connect(client, &Window::activitiesChanged, this, [this, client]() {
|
||||||
markRoleChanged(client, ActivityRole);
|
markRoleChanged(client, ActivityRole);
|
||||||
|
@ -69,7 +69,7 @@ QHash<int, QByteArray> ClientModel::roleNames() const
|
||||||
return {
|
return {
|
||||||
{Qt::DisplayRole, QByteArrayLiteral("display")},
|
{Qt::DisplayRole, QByteArrayLiteral("display")},
|
||||||
{ClientRole, QByteArrayLiteral("client")},
|
{ClientRole, QByteArrayLiteral("client")},
|
||||||
{ScreenRole, QByteArrayLiteral("screen")},
|
{OutputRole, QByteArrayLiteral("output")},
|
||||||
{DesktopRole, QByteArrayLiteral("desktop")},
|
{DesktopRole, QByteArrayLiteral("desktop")},
|
||||||
{ActivityRole, QByteArrayLiteral("activity")},
|
{ActivityRole, QByteArrayLiteral("activity")},
|
||||||
};
|
};
|
||||||
|
@ -86,8 +86,8 @@ QVariant ClientModel::data(const QModelIndex &index, int role) const
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
case ClientRole:
|
case ClientRole:
|
||||||
return QVariant::fromValue(client);
|
return QVariant::fromValue(client);
|
||||||
case ScreenRole:
|
case OutputRole:
|
||||||
return client->screen();
|
return QVariant::fromValue(client->output());
|
||||||
case DesktopRole:
|
case DesktopRole:
|
||||||
return client->desktop();
|
return client->desktop();
|
||||||
case ActivityRole:
|
case ActivityRole:
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ClientModel : public QAbstractListModel
|
||||||
public:
|
public:
|
||||||
enum Roles {
|
enum Roles {
|
||||||
ClientRole = Qt::UserRole + 1,
|
ClientRole = Qt::UserRole + 1,
|
||||||
ScreenRole,
|
OutputRole,
|
||||||
DesktopRole,
|
DesktopRole,
|
||||||
ActivityRole
|
ActivityRole
|
||||||
};
|
};
|
||||||
|
|
|
@ -326,7 +326,7 @@ void WaylandWindow::updateGeometry(const QRectF &rect)
|
||||||
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
if (oldOutput != m_output) {
|
if (oldOutput != m_output) {
|
||||||
Q_EMIT screenChanged();
|
Q_EMIT outputChanged();
|
||||||
}
|
}
|
||||||
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
|
|
|
@ -400,11 +400,6 @@ void Window::setReadyForPainting()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int Window::screen() const
|
|
||||||
{
|
|
||||||
return workspace()->outputs().indexOf(m_output);
|
|
||||||
}
|
|
||||||
|
|
||||||
Output *Window::output() const
|
Output *Window::output() const
|
||||||
{
|
{
|
||||||
return m_output;
|
return m_output;
|
||||||
|
@ -414,7 +409,7 @@ void Window::setOutput(Output *output)
|
||||||
{
|
{
|
||||||
if (m_output != output) {
|
if (m_output != output) {
|
||||||
m_output = output;
|
m_output = output;
|
||||||
Q_EMIT screenChanged();
|
Q_EMIT outputChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/window.h
12
src/window.h
|
@ -122,14 +122,9 @@ class KWIN_EXPORT Window : public QObject
|
||||||
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
|
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The screen where the window center is on
|
* The output where the window center is on
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(int screen READ screen NOTIFY screenChanged)
|
Q_PROPERTY(KWin::Output *output READ output NOTIFY outputChanged)
|
||||||
|
|
||||||
/**
|
|
||||||
* The output (screen) where the window center is on
|
|
||||||
*/
|
|
||||||
Q_PROPERTY(KWin::Output *output READ output NOTIFY screenChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(QRectF rect READ rect)
|
Q_PROPERTY(QRectF rect READ rect)
|
||||||
Q_PROPERTY(QString resourceName READ resourceName NOTIFY windowClassChanged)
|
Q_PROPERTY(QString resourceName READ resourceName NOTIFY windowClassChanged)
|
||||||
|
@ -635,7 +630,6 @@ public:
|
||||||
qreal height() const;
|
qreal height() const;
|
||||||
bool isOnOutput(Output *output) const;
|
bool isOnOutput(Output *output) const;
|
||||||
bool isOnActiveOutput() const;
|
bool isOnActiveOutput() const;
|
||||||
int screen() const;
|
|
||||||
Output *output() const;
|
Output *output() const;
|
||||||
void setOutput(Output *output);
|
void setOutput(Output *output);
|
||||||
virtual QPointF clientPos() const
|
virtual QPointF clientPos() const
|
||||||
|
@ -1465,7 +1459,7 @@ Q_SIGNALS:
|
||||||
* a screen being removed/added or if the Window's geometry changes.
|
* a screen being removed/added or if the Window's geometry changes.
|
||||||
* @since 4.11
|
* @since 4.11
|
||||||
*/
|
*/
|
||||||
void screenChanged();
|
void outputChanged();
|
||||||
void skipCloseAnimationChanged();
|
void skipCloseAnimationChanged();
|
||||||
/**
|
/**
|
||||||
* Emitted whenever the window role of the window changes.
|
* Emitted whenever the window role of the window changes.
|
||||||
|
|
|
@ -4234,7 +4234,7 @@ void X11Window::moveResizeInternal(const QRectF &rect, MoveResizeMode mode)
|
||||||
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
Q_EMIT frameGeometryChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
if (oldOutput != m_output) {
|
if (oldOutput != m_output) {
|
||||||
Q_EMIT screenChanged();
|
Q_EMIT outputChanged();
|
||||||
}
|
}
|
||||||
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
Q_EMIT geometryShapeChanged(this, oldFrameGeometry);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue