recreate plasmashellsurf on exposed, destoy on hidden
Summary: every time the window gets shown the wayland surfaces get created, when hidden, they get destroyed showevent is too early for it as they aren't there yet, use :Exposed instead, but only the first time when the surface isn't there yet Test Plan: popup applets always have correct blur in a wayland session Reviewers: #plasma, #plasma_on_wayland, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: davidedmundson, plasma-devel, #frameworks Tags: #frameworks, #plasma_on_wayland Differential Revision: https://phabricator.kde.org/D5745
This commit is contained in:
parent
028d7fec2a
commit
fd2e850156
@ -102,15 +102,6 @@ bool ToolTipDialog::event(QEvent *e)
|
|||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
|
||||||
if (e->type() == QEvent::PlatformSurface) {
|
|
||||||
auto pe = static_cast<QPlatformSurfaceEvent*>(e);
|
|
||||||
if (pe->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
|
|
||||||
KWindowSystem::setType(winId(), NET::Tooltip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool ret = Dialog::event(e);
|
bool ret = Dialog::event(e);
|
||||||
Qt::WindowFlags flags = Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint;
|
Qt::WindowFlags flags = Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint;
|
||||||
if (KWindowSystem::isPlatformX11()) {
|
if (KWindowSystem::isPlatformX11()) {
|
||||||
|
@ -1120,27 +1120,43 @@ void Dialog::showEvent(QShowEvent *event)
|
|||||||
bool Dialog::event(QEvent *event)
|
bool Dialog::event(QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::Expose) {
|
if (event->type() == QEvent::Expose) {
|
||||||
// FIXME TODO: We can remove this once we depend on Qt 5.6.1+.
|
auto ee = static_cast<QExposeEvent*>(event);
|
||||||
// See: https://bugreports.qt.io/browse/QTBUG-26978
|
|
||||||
|
if (ee->region().isNull()) {
|
||||||
|
return QQuickWindow::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* expose event is the only place where to correctly
|
||||||
|
* register our wayland extensions, as showevent is a bit too
|
||||||
|
* soon and the platform window isn't shown yet
|
||||||
|
* create a shell surface every time the window gets exposed
|
||||||
|
* (only the first expose event, guarded by shelldurface existence)
|
||||||
|
* and tear it down when the window gets hidden
|
||||||
|
* see https://phabricator.kde.org/T6064
|
||||||
|
*/
|
||||||
|
if (!d->shellSurface) {
|
||||||
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
|
d->setupWaylandIntegration();
|
||||||
|
d->updateVisibility(true);
|
||||||
|
}
|
||||||
#if (QT_VERSION > QT_VERSION_CHECK(5, 5, 0))
|
#if (QT_VERSION > QT_VERSION_CHECK(5, 5, 0))
|
||||||
} else if (event->type() == QEvent::PlatformSurface) {
|
} else if (event->type() == QEvent::PlatformSurface) {
|
||||||
const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event);
|
const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event);
|
||||||
|
|
||||||
if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
|
if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
|
||||||
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
d->setupWaylandIntegration();
|
|
||||||
} else if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed) {
|
|
||||||
#if HAVE_KWAYLAND
|
|
||||||
delete d->shellSurface;
|
|
||||||
d->shellSurface = nullptr;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if (event->type() == QEvent::Show) {
|
} else if (event->type() == QEvent::Show) {
|
||||||
d->updateVisibility(true);
|
d->updateVisibility(true);
|
||||||
} else if (event->type() == QEvent::Hide) {
|
} else if (event->type() == QEvent::Hide) {
|
||||||
d->updateVisibility(false);
|
d->updateVisibility(false);
|
||||||
|
#if HAVE_KWAYLAND
|
||||||
|
delete d->shellSurface;
|
||||||
|
d->shellSurface = nullptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
} else if (event->type() == QEvent::Move) {
|
} else if (event->type() == QEvent::Move) {
|
||||||
QMoveEvent *me = static_cast<QMoveEvent *>(event);
|
QMoveEvent *me = static_cast<QMoveEvent *>(event);
|
||||||
#if HAVE_KWAYLAND
|
#if HAVE_KWAYLAND
|
||||||
|
Loading…
x
Reference in New Issue
Block a user