mirror of
https://github.com/danog/patches.git
synced 2024-11-26 20:04:45 +01:00
87 lines
3.4 KiB
Diff
87 lines
3.4 KiB
Diff
diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp
|
|
index aa0cb58a..8b77c061 100644
|
|
--- a/examples/wayland/custom-extension/client-common/customextension.cpp
|
|
+++ b/examples/wayland/custom-extension/client-common/customextension.cpp
|
|
@@ -81,8 +81,11 @@ QWindow *CustomExtension::windowForSurface(struct ::wl_surface *surface)
|
|
|
|
bool CustomExtension::eventFilter(QObject *object, QEvent *event)
|
|
{
|
|
- if (event->type() == QEvent::PlatformSurface
|
|
- && static_cast<QPlatformSurfaceEvent*>(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
|
|
+ if (event->type() == QEvent::Expose) {
|
|
+ auto *exposeEvent = static_cast<QExposeEvent *>(event);
|
|
+ if (exposeEvent->region().isNull())
|
|
+ return false;
|
|
+
|
|
QWindow *window = qobject_cast<QWindow*>(object);
|
|
Q_ASSERT(window);
|
|
window->removeEventFilter(this);
|
|
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
|
|
index 46bef294..845bb038 100644
|
|
--- a/src/client/qwaylandintegration.cpp
|
|
+++ b/src/client/qwaylandintegration.cpp
|
|
@@ -293,12 +293,12 @@ QWaylandDisplay *QWaylandIntegration::display() const
|
|
|
|
QStringList QWaylandIntegration::themeNames() const
|
|
{
|
|
- return GenericWaylandTheme::themeNames();
|
|
+ return QGenericUnixTheme::themeNames();
|
|
}
|
|
|
|
QPlatformTheme *QWaylandIntegration::createPlatformTheme(const QString &name) const
|
|
{
|
|
- return GenericWaylandTheme::createUnixTheme(name);
|
|
+ return QGenericUnixTheme::createUnixTheme(name);
|
|
}
|
|
|
|
// May be called from non-GUI threads
|
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
index f82898bd..e2d08b35 100644
|
|
--- a/src/client/qwaylandwindow.cpp
|
|
+++ b/src/client/qwaylandwindow.cpp
|
|
@@ -98,7 +98,7 @@ QWaylandWindow::~QWaylandWindow()
|
|
delete mWindowDecoration;
|
|
|
|
if (isInitialized())
|
|
- reset(false);
|
|
+ reset();
|
|
|
|
QList<QWaylandInputDevice *> inputDevices = mDisplay->inputDevices();
|
|
for (int i = 0; i < inputDevices.size(); ++i)
|
|
@@ -128,8 +128,6 @@ void QWaylandWindow::initWindow()
|
|
|
|
if (!isInitialized()) {
|
|
initializeWlSurface();
|
|
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
|
|
- QGuiApplication::sendEvent(window(), &e);
|
|
}
|
|
|
|
if (shouldCreateSubSurface()) {
|
|
@@ -240,12 +238,8 @@ bool QWaylandWindow::shouldCreateSubSurface() const
|
|
return QPlatformWindow::parent() != nullptr;
|
|
}
|
|
|
|
-void QWaylandWindow::reset(bool sendDestroyEvent)
|
|
+void QWaylandWindow::reset()
|
|
{
|
|
- if (isInitialized() && sendDestroyEvent) {
|
|
- QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
|
|
- QGuiApplication::sendEvent(window(), &e);
|
|
- }
|
|
delete mShellSurface;
|
|
mShellSurface = nullptr;
|
|
delete mSubSurfaceWindow;
|
|
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
|
|
index 71770993..c82aa8de 100644
|
|
--- a/src/client/qwaylandwindow_p.h
|
|
+++ b/src/client/qwaylandwindow_p.h
|
|
@@ -261,7 +261,7 @@ private:
|
|
void initializeWlSurface();
|
|
bool shouldCreateShellSurface() const;
|
|
bool shouldCreateSubSurface() const;
|
|
- void reset(bool sendDestroyEvent = true);
|
|
+ void reset();
|
|
void sendExposeEvent(const QRect &rect);
|
|
static void closePopups(QWaylandWindow *parent);
|
|
QWaylandScreen *calculateScreenFromSurfaceEvents() const;
|