[server] ShellSurface's transient is a dedicated mode

So far transient was a mutual exclusive mode causing a transient window
to not be able to be fullscreen. This seems wrong. Let's have transient
still as a dedicated mode allowing the window to be maximized and/or
fullscreen. Only popup stays a dedicated mode.

REVIEW: 125468
This commit is contained in:
Martin Gräßlin 2015-10-01 08:34:30 +02:00
parent 27667222a4
commit 65444264a9
2 changed files with 4 additions and 8 deletions

View file

@ -377,7 +377,7 @@ void TestWaylandShell::testTransient()
QCOMPARE(transientOffsetSpy.count(), 1);
QCOMPARE(transientOffsetSpy.first().first().toPoint(), QPoint(10, 20));
QCOMPARE(transientForChangedSpy.count(), 1);
QCOMPARE(serverSurface->isToplevel(), false);
QCOMPARE(serverSurface->isToplevel(), true);
QCOMPARE(serverSurface->isPopup(), false);
QCOMPARE(serverSurface->isTransient(), true);
QCOMPARE(serverSurface->transientFor(), QPointer<SurfaceInterface>(serverSurface2->surface()));

View file

@ -79,7 +79,6 @@ public:
Fullscreen,
Toplevel,
Maximized,
Transient,
Popup
};
WindowMode windowMode = WindowMode::Toplevel;
@ -283,7 +282,7 @@ void ShellSurfaceInterface::Private::setTransientCallback(wl_client *client, wl_
Q_ASSERT(client == *s->client);
s->transientFor = QPointer<SurfaceInterface>(SurfaceInterface::get(parent));
s->transientOffset = QPoint(x, y);
s->setWindowMode(WindowMode::Transient);
emit s->q_func()->transientChanged(!s->transientFor.isNull());
// TODO: flags
emit s->q_func()->transientOffsetChanged(s->transientOffset);
emit s->q_func()->transientForChanged();
@ -320,10 +319,6 @@ void ShellSurfaceInterface::Private::setWindowMode(WindowMode newWindowMode)
}
if (oldWindowMode == WindowMode::Popup || newWindowMode == WindowMode::Popup) {
emit q->popupChanged(windowMode == WindowMode::Popup);
emit q->transientChanged(windowMode == WindowMode::Popup || windowMode == WindowMode::Transient);
}
if (oldWindowMode == WindowMode::Transient || newWindowMode == WindowMode::Transient) {
emit q->transientChanged(windowMode == WindowMode::Popup || windowMode == WindowMode::Transient);
}
}
@ -339,6 +334,7 @@ void ShellSurfaceInterface::Private::setPopupCallback(wl_client *client, wl_reso
s->transientFor = QPointer<SurfaceInterface>(SurfaceInterface::get(parent));
s->transientOffset = QPoint(x, y);
s->setWindowMode(WindowMode::Popup);
emit s->q_func()->transientChanged(!s->transientFor.isNull());
// TODO: flags
emit s->q_func()->transientOffsetChanged(s->transientOffset);
emit s->q_func()->transientForChanged();
@ -430,7 +426,7 @@ bool ShellSurfaceInterface::isPopup() const
bool ShellSurfaceInterface::isTransient() const
{
Q_D();
return isPopup() || d->windowMode == Private::WindowMode::Transient;
return !d->transientFor.isNull();
}
QPoint ShellSurfaceInterface::transientOffset() const