aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lipstick-asteroidos/0001-Drop-Qt-extended-surface.patch
blob: e64e7004d6ca5b35af6797d072c73044e48d1cf2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
From f321b9772bec5f7925e58435e1027ecec5a4e9a8 Mon Sep 17 00:00:00 2001
From: Chupligin Sergey <neochapay@gmail.com>
Date: Wed, 24 Mar 2021 19:39:56 +0300
Subject: [PATCH] [compositor] Drop Qt extended surface

---
 src/compositor/lipstickcompositor.cpp       | 11 ---------
 src/compositor/lipstickcompositor.h         |  7 ------
 src/compositor/lipstickcompositorwindow.cpp | 25 +++++----------------
 src/compositor/lipstickcompositorwindow.h   |  6 -----
 src/compositor/windowmodel.cpp              | 22 ------------------
 5 files changed, 5 insertions(+), 66 deletions(-)

diff --git a/src/compositor/lipstickcompositor.cpp b/src/compositor/lipstickcompositor.cpp
index 4dce9d7b..00bb548e 100644
--- a/src/compositor/lipstickcompositor.cpp
+++ b/src/compositor/lipstickcompositor.cpp
@@ -35,7 +35,6 @@
 #include <private/qguiapplication_p.h>
 #include <QtGui/qpa/qplatformintegration.h>
 #include <QWaylandQuickShellSurfaceItem>
-#include <QtWaylandCompositor/private/qwlextendedsurface_p.h>
 
 #include <mce/dbus-names.h>
 #include <mce/mode-names.h>
@@ -77,9 +76,6 @@ LipstickCompositor::LipstickCompositor()
     m_xdgShell = new QWaylandXdgShell(this);
     connect(m_xdgShell, &QWaylandXdgShell::toplevelCreated, this, &LipstickCompositor::onToplevelCreated);
 
-    m_surfExtGlob = new QtWayland::SurfaceExtensionGlobal(this);
-    connect(m_surfExtGlob, &QtWayland::SurfaceExtensionGlobal::extendedSurfaceReady, this, &LipstickCompositor::onExtendedSurfaceReady);
-
     m_wm = new QWaylandQtWindowManager(this);
     connect(m_wm, &QWaylandQtWindowManager::openUrl, this, &LipstickCompositor::openUrl);
 
@@ -194,13 +190,6 @@ void LipstickCompositor::onSurfaceCreated(QWaylandSurface *surface)
     connect(surface, SIGNAL(redraw()), this, SLOT(windowSwapped()));
 }
 
-void LipstickCompositor::onExtendedSurfaceReady(QtWayland::ExtendedSurface *extSurface, QWaylandSurface *surface)
-{
-    LipstickCompositorWindow *window = surfaceWindow(surface);
-    if(window)
-        window->setExtendedSurface(extSurface);
-}
-
 bool LipstickCompositor::openUrl(QWaylandClient *client, const QUrl &url)
 {
     Q_UNUSED(client)
diff --git a/src/compositor/lipstickcompositor.h b/src/compositor/lipstickcompositor.h
index a22b474f..b570f669 100644
--- a/src/compositor/lipstickcompositor.h
+++ b/src/compositor/lipstickcompositor.h
@@ -33,11 +33,6 @@
 #include <timed-qt5/exception>
 #include <timed-qt5/event-declarations.h>
 
-namespace QtWayland {
-    class SurfaceExtensionGlobal;
-    class ExtendedSurface;
-}
-
 class WindowModel;
 class LipstickCompositorWindow;
 class LipstickCompositorProcWindow;
@@ -191,7 +186,6 @@ private slots:
     void initialize();
 
     void onToplevelCreated(QWaylandXdgToplevel * topLevel, QWaylandXdgSurface * shellSurface);
-    void onExtendedSurfaceReady(QtWayland::ExtendedSurface *extSurface, QWaylandSurface *surface);
 
 private:
     friend class LipstickCompositorWindow;
@@ -245,7 +239,6 @@ private slots:
     QQuickWindow *m_window;
     QWaylandOutput *m_output;
     QWaylandXdgShell *m_xdgShell;
-    QtWayland::SurfaceExtensionGlobal *m_surfExtGlob;
     QWaylandQtWindowManager *m_wm;
 
     Maemo::Timed::Interface *m_timedDbus;
diff --git a/src/compositor/lipstickcompositorwindow.cpp b/src/compositor/lipstickcompositorwindow.cpp
index 5bfc79ea..db15f501 100644
--- a/src/compositor/lipstickcompositorwindow.cpp
+++ b/src/compositor/lipstickcompositorwindow.cpp
@@ -17,6 +17,7 @@
 #include <QWaylandCompositor>
 #include <QWaylandSeat>
 #include <QTimer>
+#include <QEvent>
 #include <sys/types.h>
 #include <signal.h>
 #include "lipstickcompositor.h"
@@ -28,14 +29,13 @@
 #include <EGL/egl.h>
 #include <private/qwaylandsurface_p.h>
 #include <private/qquickwindow_p.h>
-#include <QtWaylandCompositor/private/qwlextendedsurface_p.h>
 
 LipstickCompositorWindow::LipstickCompositorWindow(int windowId, const QString &category,
                                                    QWaylandSurface *surface, QQuickItem *parent)
 : QWaylandQuickItem(), m_windowId(windowId), m_category(category),
   m_delayRemove(false), m_windowClosed(false), m_removePosted(false),
   m_interceptingTouch(false), m_mapped(false), m_noHardwareComposition(false),
-  m_focusOnTouch(false), m_hasVisibleReferences(false), m_extSurface(nullptr)
+  m_focusOnTouch(false), m_hasVisibleReferences(false)
 {
     setFlags(QQuickItem::ItemIsFocusScope | flags());
 
@@ -111,29 +111,14 @@ QString LipstickCompositorWindow::category() const
     return m_category;
 }
 
-QtWayland::ExtendedSurface *LipstickCompositorWindow::extendedSurface()
-{
-    return m_extSurface;
-}
-
-void LipstickCompositorWindow::setExtendedSurface(QtWayland::ExtendedSurface *extSurface)
-{
-    m_extSurface = extSurface;
-    connect(m_extSurface, SIGNAL(windowFlagsChanged()), this, SIGNAL(windowFlagsChanged()));
-}
 
 qint16 LipstickCompositorWindow::windowFlags()
 {
-    if (m_extSurface) {
-        return m_extSurface->windowFlags();
-    }
     return 0;
 }
 
 QVariantMap LipstickCompositorWindow::windowProperties()
 {
-    if (m_extSurface)
-        return m_extSurface->windowProperties();
     return QVariantMap();
 }
 
@@ -198,15 +183,15 @@ bool LipstickCompositorWindow::eventFilter(QObject *obj, QEvent *event)
         }
         return false;
     }
-    if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
+    if (event->type() == 6 || event->type() == 7) {
         QKeyEvent *ke = static_cast<QKeyEvent *>(event);
         QWaylandSurface *m_surface = surface();
         if (m_surface) {
             QWaylandSeat *inputDevice = m_surface->compositor()->seatFor(ke);
-            if (event->type() == QEvent::KeyPress)
+            if (event->type() == 6) //KeyPress
                 inputDevice->setKeyboardFocus(m_surface);
             inputDevice->sendFullKeyEvent(ke);
-            if (event->type() == QEvent::KeyRelease)
+            if (event->type() == 7) //KeyRelease
                 qApp->removeEventFilter(this);
             return true;
         }
diff --git a/src/compositor/lipstickcompositorwindow.h b/src/compositor/lipstickcompositorwindow.h
index c85e46ad..4af3693c 100644
--- a/src/compositor/lipstickcompositorwindow.h
+++ b/src/compositor/lipstickcompositorwindow.h
@@ -20,9 +20,6 @@
 #include <QWaylandBufferRef>
 #include "lipstickglobal.h"
 
-namespace QtWayland {
-    class ExtendedSurface;
-}
 class LipstickCompositorWindowHwcNode;
 
 class LIPSTICK_EXPORT LipstickCompositorWindow : public QWaylandQuickItem
@@ -106,8 +103,6 @@ private slots:
     void tryRemove();
     void handleTouchEvent(QTouchEvent *e);
 
-    void setExtendedSurface(QtWayland::ExtendedSurface *extSurface);
-    QtWayland::ExtendedSurface *extendedSurface();
     void setTitle(QString title);
     QString m_title;
 
@@ -124,7 +119,6 @@ private slots:
     QVariant m_data;
     QList<QMetaObject::Connection> m_surfaceConnections;
     QVector<QQuickItem *> m_refs;
-    QtWayland::ExtendedSurface *m_extSurface;
 };
 
 #endif // LIPSTICKCOMPOSITORWINDOW_H
diff --git a/src/compositor/windowmodel.cpp b/src/compositor/windowmodel.cpp
index 245e23a2..c942d493 100644
--- a/src/compositor/windowmodel.cpp
+++ b/src/compositor/windowmodel.cpp
@@ -14,7 +14,6 @@
 ****************************************************************************/
 
 #include <QDBusConnection>
-#include <QtWaylandCompositor/private/qwlextendedsurface_p.h>
 #include "lipstickcompositorwindow.h"
 #include "lipstickcompositor.h"
 #include "windowmodel.h"
@@ -202,27 +201,6 @@ void WindowModel::launchProcess(const QString &binaryName)
                 proc << part;
             }
         }
-
-        // Cannot match, as the cmdline has less arguments than then binary part
-        if (binaryParts.size() > proc.size()) {
-            continue;
-        }
-
-        bool match = true;
-
-        // All parts of binaryName must be contained in this order in the
-        // process command line to match the given process
-        for (int i=0; i<binaryParts.count(); i++) {
-            if (proc[i] != binaryParts[i]) {
-                match = false;
-                break;
-            }
-        }
-
-        if (match) {
-            emit win->extendedSurface()->raiseRequested();
-            break;
-        }
     }
 }