summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-11 16:07:23 +0200
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-08-28 13:10:33 +0200
commite01b81339a37830c48f2cec0583e5d0aba592601 (patch)
treebd3085460c0139a10c5fd5d322b9059e6c97b5ee /src/compositor/extensions
parentbc331abe8e8ffaa3db12be7ae69e7b658dd700ac (diff)
Remove QtWayland::Surface
Its enough to have QWaylandSurface and QWaylandSurfacePrivate. Also don't pass QWaylandSurfacePrivate around, but pass QWaylandSurface and then use the QWaylandSurfacePrivate::get function. Change-Id: I915cc9d7b4497ad1c6f1f2dee61d9d0db069ba6b
Diffstat (limited to 'src/compositor/extensions')
-rw-r--r--src/compositor/extensions/qwlextendedsurface.cpp15
-rw-r--r--src/compositor/extensions/qwlextendedsurface_p.h9
-rw-r--r--src/compositor/extensions/qwlinputpanel.cpp7
-rw-r--r--src/compositor/extensions/qwlinputpanel_p.h7
-rw-r--r--src/compositor/extensions/qwlinputpanelsurface.cpp7
-rw-r--r--src/compositor/extensions/qwlinputpanelsurface_p.h7
-rw-r--r--src/compositor/extensions/qwlqtkey.cpp8
-rw-r--r--src/compositor/extensions/qwlqtkey_p.h4
-rw-r--r--src/compositor/extensions/qwlqttouch.cpp3
-rw-r--r--src/compositor/extensions/qwlshellsurface.cpp34
-rw-r--r--src/compositor/extensions/qwlshellsurface_p.h14
-rw-r--r--src/compositor/extensions/qwlsubsurface.cpp3
-rw-r--r--src/compositor/extensions/qwlsubsurface_p.h8
-rw-r--r--src/compositor/extensions/qwltextinput.cpp7
-rw-r--r--src/compositor/extensions/qwltextinput_p.h7
15 files changed, 71 insertions, 69 deletions
diff --git a/src/compositor/extensions/qwlextendedsurface.cpp b/src/compositor/extensions/qwlextendedsurface.cpp
index c9aae421a..21292c14d 100644
--- a/src/compositor/extensions/qwlextendedsurface.cpp
+++ b/src/compositor/extensions/qwlextendedsurface.cpp
@@ -37,7 +37,6 @@
#include "qwlextendedsurface_p.h"
#include "qwlcompositor_p.h"
-#include "qwlsurface_p.h"
QT_BEGIN_NAMESPACE
@@ -53,12 +52,12 @@ void SurfaceExtensionGlobal::surface_extension_get_extended_surface(Resource *re
uint32_t id,
struct wl_resource *surface_resource)
{
- Surface *surface = Surface::fromResource(surface_resource);
+ QWaylandSurface *surface = QWaylandSurface::fromResource(surface_resource);
new ExtendedSurface(resource->client(),id, wl_resource_get_version(resource->handle), surface);
}
-ExtendedSurface::ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface)
- : QWaylandExtensionTemplate(surface->waylandSurface())
+ExtendedSurface::ExtendedSurface(struct wl_client *client, uint32_t id, int version, QWaylandSurface *surface)
+ : QWaylandExtensionTemplate(surface)
, QtWaylandServer::qt_extended_surface(client, id, version)
, m_surface(surface)
, m_windowFlags(0)
@@ -88,7 +87,7 @@ void ExtendedSurface::setVisibility(QWindow::Visibility visibility)
send_onscreen_visibility(visibility);
}
-void ExtendedSurface::setParentSurface(Surface *surface)
+void ExtendedSurface::setParentSurface(QWaylandSurface *surface)
{
m_surface = surface;
}
@@ -172,14 +171,12 @@ void ExtendedSurface::extended_surface_destroy_resource(Resource *)
void ExtendedSurface::extended_surface_raise(Resource *)
{
- if (m_surface)
- emit m_surface->waylandSurface()->raiseRequested();
+ emit raiseRequested();
}
void ExtendedSurface::extended_surface_lower(Resource *)
{
- if (m_surface)
- emit m_surface->waylandSurface()->lowerRequested();
+ emit lowerRequested();
}
}
diff --git a/src/compositor/extensions/qwlextendedsurface_p.h b/src/compositor/extensions/qwlextendedsurface_p.h
index f666c44a3..052ecf5e4 100644
--- a/src/compositor/extensions/qwlextendedsurface_p.h
+++ b/src/compositor/extensions/qwlextendedsurface_p.h
@@ -40,7 +40,6 @@
#include <wayland-server.h>
#include <QtCompositor/private/qwayland-server-surface-extension.h>
-#include <private/qwlsurface_p.h>
#include <QtCompositor/qwaylandsurface.h>
#include <QtCompositor/qwaylandextension.h>
@@ -82,7 +81,7 @@ public:
};
Q_DECLARE_FLAGS(WindowFlags, WindowFlag)
- ExtendedSurface(struct wl_client *client, uint32_t id, int version, Surface *surface);
+ ExtendedSurface(struct wl_client *client, uint32_t id, int version, QWaylandSurface *surface);
~ExtendedSurface();
void sendGenericProperty(const QString &name, const QVariant &variant);
@@ -95,7 +94,7 @@ public:
ExtendedSurface *parent() const;
void setParent(ExtendedSurface *parent);
QLinkedList<QWaylandSurface *> subSurfaces() const;
- void setParentSurface(Surface *s);
+ void setParentSurface(QWaylandSurface *s);
Qt::ScreenOrientations contentOrientationMask() const;
@@ -109,11 +108,13 @@ Q_SIGNALS:
void contentOrientationMaskChanged();
void windowFlagsChanged();
void windowPropertyChanged(const QString &name, const QVariant &value);
+ void raiseRequested();
+ void lowerRequested();
private:
void setWindowPropertyImpl(const QString &name, const QVariant &value);
- Surface *m_surface;
+ QWaylandSurface *m_surface;
Qt::ScreenOrientations m_contentOrientationMask;
diff --git a/src/compositor/extensions/qwlinputpanel.cpp b/src/compositor/extensions/qwlinputpanel.cpp
index 4b0016aa2..cc4836bc7 100644
--- a/src/compositor/extensions/qwlinputpanel.cpp
+++ b/src/compositor/extensions/qwlinputpanel.cpp
@@ -42,7 +42,6 @@
#include "qwlinputdevice_p.h"
#include "qwlinputmethod_p.h"
#include "qwlinputpanelsurface_p.h"
-#include "qwlsurface_p.h"
#include "qwltextinput_p.h"
QT_BEGIN_NAMESPACE
@@ -68,12 +67,12 @@ QWaylandInputPanel *QWaylandInputPanelPrivate::waylandInputPanel() const
return panel;
}
-QtWayland::Surface *QWaylandInputPanelPrivate::focus() const
+QWaylandSurface *QWaylandInputPanelPrivate::focus() const
{
return m_focus;
}
-void QWaylandInputPanelPrivate::setFocus(QtWayland::Surface *focus)
+void QWaylandInputPanelPrivate::setFocus(QWaylandSurface *focus)
{
Q_Q(QWaylandInputPanel);
if (m_focus == focus)
@@ -126,7 +125,7 @@ QWaylandInputPanelPrivate *QWaylandInputPanelPrivate::findIn(QWaylandExtensionCo
void QWaylandInputPanelPrivate::input_panel_get_input_panel_surface(Resource *resource, uint32_t id, wl_resource *surface)
{
- new QtWayland::InputPanelSurface(resource->client(), id, QtWayland::Surface::fromResource(surface));
+ new QtWayland::InputPanelSurface(resource->client(), id, QWaylandSurface::fromResource(surface));
}
QT_END_NAMESPACE
diff --git a/src/compositor/extensions/qwlinputpanel_p.h b/src/compositor/extensions/qwlinputpanel_p.h
index 1e41296b5..65718892b 100644
--- a/src/compositor/extensions/qwlinputpanel_p.h
+++ b/src/compositor/extensions/qwlinputpanel_p.h
@@ -50,7 +50,6 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
class Compositor;
-class Surface;
class TextInput;
}
@@ -64,8 +63,8 @@ public:
QWaylandInputPanel *waylandInputPanel() const;
- QtWayland::Surface *focus() const;
- void setFocus(QtWayland::Surface *focus);
+ QWaylandSurface *focus() const;
+ void setFocus(QWaylandSurface *focus);
bool inputPanelVisible() const;
void setInputPanelVisible(bool inputPanelVisible);
@@ -80,7 +79,7 @@ protected:
private:
QtWayland::Compositor *m_compositor;
- QtWayland::Surface *m_focus;
+ QWaylandSurface *m_focus;
bool m_inputPanelVisible;
QRect m_cursorRectangle;
};
diff --git a/src/compositor/extensions/qwlinputpanelsurface.cpp b/src/compositor/extensions/qwlinputpanelsurface.cpp
index a72afa2b3..55c03eaae 100644
--- a/src/compositor/extensions/qwlinputpanelsurface.cpp
+++ b/src/compositor/extensions/qwlinputpanelsurface.cpp
@@ -38,20 +38,21 @@
#include "qwlinputpanelsurface_p.h"
#include "qwloutput_p.h"
-#include "qwlsurface_p.h"
+
+#include <QtCompositor/private/qwaylandsurface_p.h>
QT_BEGIN_NAMESPACE
namespace QtWayland {
-InputPanelSurface::InputPanelSurface(wl_client *client, int id, Surface *surface)
+InputPanelSurface::InputPanelSurface(wl_client *client, int id, QWaylandSurface *surface)
: QtWaylandServer::wl_input_panel_surface(client, id, 1)
, m_surface(surface)
, m_type(Invalid)
, m_output(0)
, m_position()
{
- surface->setInputPanelSurface(this);
+ QWaylandSurfacePrivate::get(surface)->setInputPanelSurface(this);
}
InputPanelSurface::Type InputPanelSurface::type() const
diff --git a/src/compositor/extensions/qwlinputpanelsurface_p.h b/src/compositor/extensions/qwlinputpanelsurface_p.h
index 0591832fb..947c9d95f 100644
--- a/src/compositor/extensions/qwlinputpanelsurface_p.h
+++ b/src/compositor/extensions/qwlinputpanelsurface_p.h
@@ -40,12 +40,13 @@
#include <QtCompositor/private/qwayland-server-input-method.h>
+#include <QWaylandSurface>
+
QT_BEGIN_NAMESPACE
namespace QtWayland {
class Output;
-class Surface;
class InputPanelSurface : public QtWaylandServer::wl_input_panel_surface
{
@@ -56,7 +57,7 @@ public:
OverlayPanel
};
- InputPanelSurface(struct ::wl_client *client, int id, Surface *surface);
+ InputPanelSurface(struct ::wl_client *client, int id, QWaylandSurface *surface);
Type type() const;
@@ -68,7 +69,7 @@ protected:
void input_panel_surface_set_toplevel(Resource *resource, wl_resource *output_resource, uint32_t position) Q_DECL_OVERRIDE;
private:
- Surface *m_surface;
+ QWaylandSurface *m_surface;
Type m_type;
diff --git a/src/compositor/extensions/qwlqtkey.cpp b/src/compositor/extensions/qwlqtkey.cpp
index cc6bb7afd..875524bf5 100644
--- a/src/compositor/extensions/qwlqtkey.cpp
+++ b/src/compositor/extensions/qwlqtkey.cpp
@@ -35,7 +35,7 @@
****************************************************************************/
#include "qwlqtkey_p.h"
-#include "qwlsurface_p.h"
+#include <QtCompositor/QWaylandSurface>
#include <QKeyEvent>
#include <QWindow>
@@ -50,15 +50,15 @@ QtKeyExtensionGlobal::QtKeyExtensionGlobal(Compositor *compositor)
{
}
-bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, Surface *surface)
+bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, QWaylandSurface *surface)
{
uint32_t time = m_compositor->currentTimeMsecs();
- Resource *target = surface ? resourceMap().value(surface->resource()->client()) : 0;
+ Resource *target = surface ? resourceMap().value(surface->waylandClient()) : 0;
if (target) {
send_qtkey(target->handle,
- surface ? surface->resource()->handle : 0,
+ surface ? surface->resource() : 0,
time, event->type(), event->key(), event->modifiers(),
event->nativeScanCode(),
event->nativeVirtualKey(),
diff --git a/src/compositor/extensions/qwlqtkey_p.h b/src/compositor/extensions/qwlqtkey_p.h
index fa78037d3..67474ffc6 100644
--- a/src/compositor/extensions/qwlqtkey_p.h
+++ b/src/compositor/extensions/qwlqtkey_p.h
@@ -45,8 +45,8 @@
QT_BEGIN_NAMESPACE
+class QWaylandSurface;
class Compositor;
-class Surface;
class QKeyEvent;
namespace QtWayland {
@@ -57,7 +57,7 @@ class QtKeyExtensionGlobal : public QWaylandExtensionTemplate<QtKeyExtensionGlob
public:
QtKeyExtensionGlobal(Compositor *compositor);
- bool postQtKeyEvent(QKeyEvent *event, Surface *surface);
+ bool postQtKeyEvent(QKeyEvent *event, QWaylandSurface *surface);
private:
Compositor *m_compositor;
diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp
index 19f5b3936..9c476dbf7 100644
--- a/src/compositor/extensions/qwlqttouch.cpp
+++ b/src/compositor/extensions/qwlqttouch.cpp
@@ -35,7 +35,6 @@
****************************************************************************/
#include "qwlqttouch_p.h"
-#include "qwlsurface_p.h"
#include "qwaylandview.h"
#include <QTouchEvent>
#include <QWindow>
@@ -73,7 +72,7 @@ bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, QWaylandView *view
return false;
QPointF surfacePos = view->requestedPosition();
- wl_client *surfaceClient = view->surface()->handle()->resource()->client();
+ wl_client *surfaceClient = view->surface()->client()->client();
uint32_t time = m_compositor->currentTimeMsecs();
const int rescount = m_resources.count();
diff --git a/src/compositor/extensions/qwlshellsurface.cpp b/src/compositor/extensions/qwlshellsurface.cpp
index 1a4e87bbb..3e0535ca1 100644
--- a/src/compositor/extensions/qwlshellsurface.cpp
+++ b/src/compositor/extensions/qwlshellsurface.cpp
@@ -38,7 +38,6 @@
#include "qwlshellsurface_p.h"
#include "qwlcompositor_p.h"
-#include "qwlsurface_p.h"
#include "qwloutput_p.h"
#include "qwlinputdevice_p.h"
#include "qwlsubsurface_p.h"
@@ -72,13 +71,13 @@ ShellSurfacePopupGrabber *Shell::getPopupGrabber(QWaylandInputDevice *input)
void Shell::shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface_res)
{
- Surface *surface = Surface::fromResource(surface_res);
+ QWaylandSurface *surface = QWaylandSurface::fromResource(surface_res);
ShellSurface *shell_surface = new ShellSurface(this, resource->client(), id, surface);
- emit shellSurfaceCreated(surface->waylandSurface(), shell_surface);
+ emit shellSurfaceCreated(surface, shell_surface);
}
-ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface *surface)
- : QWaylandExtensionTemplate(surface->waylandSurface())
+ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, QWaylandSurface *surface)
+ : QWaylandExtensionTemplate(surface)
, wl_shell_surface(client, id, 1)
, m_shell(shell)
, m_surface(surface)
@@ -92,8 +91,8 @@ ShellSurface::ShellSurface(Shell *shell, wl_client *client, uint32_t id, Surface
, m_transientParent(0)
, m_transientOffset()
{
- connect(surface->waylandSurface(), &QWaylandSurface::mappedChanged, this, &ShellSurface::mappedChanged);
- connect(surface->waylandSurface(), &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset);
+ connect(surface, &QWaylandSurface::mappedChanged, this, &ShellSurface::mappedChanged);
+ connect(surface, &QWaylandSurface::offsetForNextFrame, this, &ShellSurface::adjustOffset);
}
ShellSurface::~ShellSurface()
@@ -108,7 +107,7 @@ void ShellSurface::sendConfigure(uint32_t edges, int32_t width, int32_t height)
void ShellSurface::ping()
{
- uint32_t serial = wl_display_next_serial(m_surface->compositor()->wl_display());
+ uint32_t serial = wl_display_next_serial(m_surface->compositor()->waylandDisplay());
ping(serial);
}
@@ -170,11 +169,11 @@ void ShellSurface::setOffset(const QPointF &offset)
void ShellSurface::mappedChanged()
{
- if (!m_surface->waylandSurface()->isMapped())
+ if (!m_surface->isMapped())
return;
if (m_surfaceType == Popup) {
- if (m_surface->mapped() && m_popupGrabber->grabSerial() == m_popupSerial) {
+ if (m_surface->isMapped() && m_popupGrabber->grabSerial() == m_popupSerial) {
m_popupGrabber->addPopup(this);
} else {
send_popup_done();
@@ -261,8 +260,6 @@ void ShellSurface::shell_surface_set_toplevel(Resource *resource)
setTransientOffset(QPointF(0, 0));
setSurfaceType(Toplevel);
-
- m_surface->setVisibility(QWindow::Windowed);
}
void ShellSurface::shell_surface_set_transient(Resource *resource,
@@ -283,8 +280,6 @@ void ShellSurface::shell_surface_set_transient(Resource *resource,
m_transientInactive = false;
setSurfaceType(Transient);
-
- m_surface->setVisibility(QWindow::AutomaticVisibility);
}
void ShellSurface::shell_surface_set_fullscreen(Resource *resource,
@@ -317,7 +312,6 @@ void ShellSurface::shell_surface_set_fullscreen(Resource *resource,
m_view->setRequestedPosition(output->geometry().topLeft());
send_configure(resize_bottom_right, outputSize.width(), outputSize.height());
- m_surface->setVisibility(QWindow::FullScreen);
}
void ShellSurface::shell_surface_set_popup(Resource *resource, wl_resource *input_device, uint32_t serial, wl_resource *parent, int32_t x, int32_t y, uint32_t flags)
@@ -335,7 +329,6 @@ void ShellSurface::shell_surface_set_popup(Resource *resource, wl_resource *inpu
setSurfaceType(Popup);
- m_surface->setVisibility(QWindow::AutomaticVisibility);
}
void ShellSurface::shell_surface_set_maximized(Resource *resource,
@@ -365,7 +358,6 @@ void ShellSurface::shell_surface_set_maximized(Resource *resource,
m_view->setRequestedPosition(output->availableGeometry().topLeft());
send_configure(resize_bottom_right, outputSize.width(), outputSize.height());
- m_surface->setVisibility(QWindow::Maximized);
}
void ShellSurface::shell_surface_pong(Resource *resource,
@@ -373,7 +365,7 @@ void ShellSurface::shell_surface_pong(Resource *resource,
{
Q_UNUSED(resource);
if (m_pings.remove(serial))
- emit m_surface->waylandSurface()->pong();
+ emit pong();
else
qWarning("Received an unexpected pong!");
}
@@ -382,14 +374,16 @@ void ShellSurface::shell_surface_set_title(Resource *resource,
const QString &title)
{
Q_UNUSED(resource);
- m_surface->setTitle(title);
+ m_title = title;
+ emit titleChanged();
}
void ShellSurface::shell_surface_set_class(Resource *resource,
const QString &className)
{
Q_UNUSED(resource);
- m_surface->setClassName(className);
+ m_className = className;
+ emit classNameChanged();
}
ShellSurfaceGrabber::ShellSurfaceGrabber(ShellSurface *shellSurface)
diff --git a/src/compositor/extensions/qwlshellsurface_p.h b/src/compositor/extensions/qwlshellsurface_p.h
index d222fba03..b7e28f8aa 100644
--- a/src/compositor/extensions/qwlshellsurface_p.h
+++ b/src/compositor/extensions/qwlshellsurface_p.h
@@ -83,6 +83,8 @@ class Q_COMPOSITOR_EXPORT ShellSurface : public QWaylandExtensionTemplate<ShellS
{
Q_OBJECT
Q_PROPERTY(SurfaceType surfaceType READ surfaceType WRITE setSurfaceType NOTIFY surfaceTypeChanged)
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QString className READ className NOTIFY classNameChanged)
public:
enum SurfaceType {
None,
@@ -91,7 +93,7 @@ public:
Popup
};
- ShellSurface(Shell *shell, struct wl_client *client, uint32_t id, Surface *surface);
+ ShellSurface(Shell *shell, struct wl_client *client, uint32_t id, QWaylandSurface *surface);
~ShellSurface();
void sendConfigure(uint32_t edges, int32_t width, int32_t height);
@@ -120,8 +122,13 @@ public:
void setTransientOffset(const QPointF &offset) { m_transientOffset = offset; }
QPointF transientOffset() const { return m_transientOffset; }
+ QString title() const { return m_title; }
+ QString className() const { return m_className; }
Q_SIGNALS:
void surfaceTypeChanged();
+ void titleChanged();
+ void classNameChanged();
+ void pong();
private Q_SLOTS:
void mappedChanged();
@@ -129,7 +136,7 @@ private Q_SLOTS:
private:
Shell *m_shell;
- Surface *m_surface;
+ QWaylandSurface *m_surface;
QWaylandView *m_view;
ShellSurfaceResizeGrabber *m_resizeGrabber;
@@ -146,6 +153,9 @@ private:
QWaylandSurface *m_transientParent;
QPointF m_transientOffset;
+ QString m_title;
+ QString m_className;
+
void shell_surface_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
void shell_surface_move(Resource *resource,
diff --git a/src/compositor/extensions/qwlsubsurface.cpp b/src/compositor/extensions/qwlsubsurface.cpp
index 4baa81106..8932748f7 100644
--- a/src/compositor/extensions/qwlsubsurface.cpp
+++ b/src/compositor/extensions/qwlsubsurface.cpp
@@ -74,7 +74,8 @@ SubSurface::~SubSurface()
}
QLinkedList<QWaylandSurface *>::iterator it;
for (it = m_sub_surfaces.begin(); it != m_sub_surfaces.end(); ++it) {
- (*it)->handle()->subSurface()->parentDestroyed();
+ SubSurface *subSurfaceSub = SubSurface::findIn(*it);
+ subSurfaceSub->parentDestroyed();
}
}
diff --git a/src/compositor/extensions/qwlsubsurface_p.h b/src/compositor/extensions/qwlsubsurface_p.h
index d86b6e7ea..70083fca3 100644
--- a/src/compositor/extensions/qwlsubsurface_p.h
+++ b/src/compositor/extensions/qwlsubsurface_p.h
@@ -37,16 +37,16 @@
#ifndef WLSUBSURFACE_H
#define WLSUBSURFACE_H
-#include <private/qwlsurface_p.h>
-
#include <QtCompositor/private/qwayland-server-sub-surface-extension.h>
+#include <QtCompositor/QWaylandExtension>
+#include <QtCompositor/QWaylandSurface>
+
#include <QtCore/QLinkedList>
QT_BEGIN_NAMESPACE
class Compositor;
-class QWaylandSurface;
namespace QtWayland {
@@ -62,7 +62,7 @@ private:
void sub_surface_extension_get_sub_surface_aware_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) Q_DECL_OVERRIDE;
};
-class SubSurface : public QWaylandExtensionTemplate<SubSurface>, public QtWaylandServer::qt_sub_surface
+class Q_COMPOSITOR_EXPORT SubSurface : public QWaylandExtensionTemplate<SubSurface>, public QtWaylandServer::qt_sub_surface
{
Q_OBJECT
Q_PROPERTY(SubSurface *parent READ parent WRITE setParent NOTIFY parentChanged)
diff --git a/src/compositor/extensions/qwltextinput.cpp b/src/compositor/extensions/qwltextinput.cpp
index 1da6acef1..465972d8f 100644
--- a/src/compositor/extensions/qwltextinput.cpp
+++ b/src/compositor/extensions/qwltextinput.cpp
@@ -41,7 +41,6 @@
#include "qwlinputmethod_p.h"
#include "qwlinputmethodcontext_p.h"
#include "qwlinputpanel_p.h"
-#include "qwlsurface_p.h"
#include <algorithm>
@@ -59,7 +58,7 @@ TextInput::TextInput(QWaylandExtensionContainer *container, Compositor *composit
{
}
-Surface *TextInput::focus() const
+QWaylandSurface *TextInput::focus() const
{
return m_focus;
}
@@ -94,8 +93,8 @@ void TextInput::text_input_destroy_resource(Resource *)
void TextInput::text_input_activate(Resource *, wl_resource *seat, wl_resource *surface)
{
- Surface *oldSurface = m_focus;
- m_focus = Surface::fromResource(surface);
+ QWaylandSurface *oldSurface = m_focus;
+ m_focus = QWaylandSurface::fromResource(surface);
if (oldSurface != m_focus)
send_leave();
diff --git a/src/compositor/extensions/qwltextinput_p.h b/src/compositor/extensions/qwltextinput_p.h
index 7580c86f2..bd4b212f4 100644
--- a/src/compositor/extensions/qwltextinput_p.h
+++ b/src/compositor/extensions/qwltextinput_p.h
@@ -44,18 +44,19 @@
QT_BEGIN_NAMESPACE
+class QWaylandSurface;
+
namespace QtWayland {
class Compositor;
class InputMethod;
-class Surface;
class TextInput : public QWaylandExtensionTemplate<TextInput>, public QtWaylandServer::wl_text_input
{
public:
explicit TextInput(QWaylandExtensionContainer *container, Compositor *compositor, struct ::wl_client *client, int id);
- Surface *focus() const;
+ QWaylandSurface *focus() const;
bool inputPanelVisible() const;
QRect cursorRectangle() const;
@@ -80,7 +81,7 @@ protected:
private:
Compositor *m_compositor;
QList<InputMethod*> m_activeInputMethods;
- Surface *m_focus;
+ QWaylandSurface *m_focus;
bool m_inputPanelVisible;
QRect m_cursorRectangle;