Address code formatting
This commit is contained in:
parent
1bf7276d53
commit
cd9b1a6fd3
12 changed files with 80 additions and 90 deletions
|
@ -5,8 +5,8 @@
|
|||
*/
|
||||
|
||||
#include "shell.h"
|
||||
#include <qglobal.h>
|
||||
#include <QByteArray>
|
||||
#include <qglobal.h>
|
||||
|
||||
using namespace LayerShellQt;
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets the right environment so the shells created from now on use wlr-layer-shell.
|
||||
*/
|
||||
class LAYERSHELLQT_EXPORT Shell {
|
||||
class LAYERSHELLQT_EXPORT Shell
|
||||
{
|
||||
public:
|
||||
static void useLayerShell();
|
||||
};
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
*/
|
||||
|
||||
#include "window.h"
|
||||
#include <private/qwaylandwindow_p.h>
|
||||
#include <private/qwaylandshellsurface_p.h>
|
||||
#include <layershellqt_logging.h>
|
||||
#include "../qwaylandlayersurface_p.h"
|
||||
#include <layershellqt_logging.h>
|
||||
#include <private/qwaylandshellsurface_p.h>
|
||||
#include <private/qwaylandwindow_p.h>
|
||||
|
||||
using namespace LayerShellQt;
|
||||
|
||||
|
@ -47,7 +47,8 @@ void Window::setKeyboardInteractivity(bool enabled)
|
|||
|
||||
Window::Window(WindowPrivate *d)
|
||||
: d(d)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
Window *Window::get(QWindow *window)
|
||||
{
|
||||
|
@ -56,7 +57,7 @@ Window *Window::get(QWindow *window)
|
|||
qCDebug(LAYERSHELLQT) << "window not a wayland window" << window;
|
||||
return nullptr;
|
||||
}
|
||||
QWaylandLayerSurface* s = qobject_cast<QWaylandLayerSurface *>(ww->shellSurface());
|
||||
QWaylandLayerSurface *s = qobject_cast<QWaylandLayerSurface *>(ww->shellSurface());
|
||||
if (!s) {
|
||||
qCDebug(LAYERSHELLQT) << "window not using wlr-layer-shell" << window << ww->shellSurface();
|
||||
return nullptr;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
QWaylandLayerShell::QWaylandLayerShell(QtWayland::zwlr_layer_shell_v1 *shell)
|
||||
: QtWayland::zwlr_layer_shell_v1(shell->object())
|
||||
{
|
||||
|
@ -22,8 +22,7 @@ QWaylandLayerShell::~QWaylandLayerShell()
|
|||
zwlr_layer_shell_v1_destroy(object());
|
||||
}
|
||||
|
||||
QWaylandLayerSurface *QWaylandLayerShell::createLayerSurface(
|
||||
QtWaylandClient::QWaylandWindow *window)
|
||||
QWaylandLayerSurface *QWaylandLayerShell::createLayerSurface(QtWaylandClient::QWaylandWindow *window)
|
||||
{
|
||||
return new QWaylandLayerSurface(this, window);
|
||||
}
|
||||
|
|
|
@ -10,21 +10,20 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
|
||||
#include "qwaylandlayersurface_p.h"
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1
|
||||
{
|
||||
public:
|
||||
QWaylandLayerShell(QtWayland::zwlr_layer_shell_v1 *shell);
|
||||
virtual ~QWaylandLayerShell();
|
||||
|
||||
QWaylandLayerSurface *createLayerSurface(
|
||||
QtWaylandClient::QWaylandWindow *window);
|
||||
QWaylandLayerSurface *createLayerSurface(QtWaylandClient::QWaylandWindow *window);
|
||||
// TODO: Popups
|
||||
};
|
||||
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
* SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include "qwaylandlayershellintegration_p.h"
|
||||
#include "qwaylandlayershell_p.h"
|
||||
#include "qwaylandlayershellintegration_p.h"
|
||||
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration() :
|
||||
m_layerShell(Q_NULLPTR)
|
||||
namespace LayerShellQt
|
||||
{
|
||||
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration()
|
||||
: m_layerShell(Q_NULLPTR)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -26,22 +26,17 @@ bool QWaylandLayerShellIntegration::initialize(QtWaylandClient::QWaylandDisplay
|
|||
return m_layerShell != nullptr;
|
||||
}
|
||||
|
||||
QtWaylandClient::QWaylandShellSurface *QWaylandLayerShellIntegration::
|
||||
createShellSurface(QtWaylandClient::QWaylandWindow *window)
|
||||
QtWaylandClient::QWaylandShellSurface *QWaylandLayerShellIntegration::createShellSurface(QtWaylandClient::QWaylandWindow *window)
|
||||
{
|
||||
return m_layerShell->createLayerSurface(window);
|
||||
}
|
||||
|
||||
void QWaylandLayerShellIntegration::registryLayer(void *data,
|
||||
struct wl_registry *registry, uint32_t id,
|
||||
const QString &interface, uint32_t version)
|
||||
void QWaylandLayerShellIntegration::registryLayer(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
|
||||
{
|
||||
QWaylandLayerShellIntegration *shell =
|
||||
static_cast<QWaylandLayerShellIntegration *>(data);
|
||||
QWaylandLayerShellIntegration *shell = static_cast<QWaylandLayerShellIntegration *>(data);
|
||||
|
||||
if (interface == QStringLiteral("zwlr_layer_shell_v1"))
|
||||
shell->m_layerShell = new QWaylandLayerShell(
|
||||
new QtWayland::zwlr_layer_shell_v1(registry, id, version));
|
||||
shell->m_layerShell = new QWaylandLayerShell(new QtWayland::zwlr_layer_shell_v1(registry, id, version));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||
#include "layershellqt_export.h"
|
||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
class QWaylandLayerShell;
|
||||
|
||||
class LAYERSHELLQT_EXPORT QWaylandLayerShellIntegration : public QtWaylandClient::QWaylandShellIntegration
|
||||
|
@ -23,12 +23,10 @@ public:
|
|||
QWaylandLayerShellIntegration();
|
||||
|
||||
bool initialize(QtWaylandClient::QWaylandDisplay *display) override;
|
||||
QtWaylandClient::QWaylandShellSurface *createShellSurface(
|
||||
QtWaylandClient::QWaylandWindow *window) override;
|
||||
QtWaylandClient::QWaylandShellSurface *createShellSurface(QtWaylandClient::QWaylandWindow *window) override;
|
||||
|
||||
private:
|
||||
static void registryLayer(void *data, struct wl_registry *registry,
|
||||
uint32_t id, const QString &interface, uint32_t version);
|
||||
static void registryLayer(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version);
|
||||
|
||||
QWaylandLayerShell *m_layerShell;
|
||||
};
|
||||
|
|
|
@ -5,27 +5,26 @@
|
|||
* SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
|
||||
#include "qwaylandlayershellintegration_p.h"
|
||||
#include <QtWaylandClient/private/qwaylandshellintegrationplugin_p.h>
|
||||
|
||||
using namespace LayerShellQt;
|
||||
|
||||
class QWaylandLayerShellIntegrationPlugin :
|
||||
public QtWaylandClient::QWaylandShellIntegrationPlugin
|
||||
class QWaylandLayerShellIntegrationPlugin : public QtWaylandClient::QWaylandShellIntegrationPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(
|
||||
IID QWaylandShellIntegrationFactoryInterface_iid
|
||||
FILE "layer-shell.json")
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID QWaylandShellIntegrationFactoryInterface_iid FILE "layer-shell.json")
|
||||
|
||||
public:
|
||||
QWaylandLayerShellIntegrationPlugin() {}
|
||||
QWaylandLayerShellIntegrationPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
QtWaylandClient::QWaylandShellIntegration *create(
|
||||
const QString &key, const QStringList ¶mList) override {
|
||||
Q_UNUSED(key);
|
||||
Q_UNUSED(paramList);
|
||||
return new QWaylandLayerShellIntegration();
|
||||
QtWaylandClient::QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) override
|
||||
{
|
||||
Q_UNUSED(key);
|
||||
Q_UNUSED(paramList);
|
||||
return new QWaylandLayerShellIntegration();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -8,21 +8,21 @@
|
|||
#include "qwaylandlayershell_p.h"
|
||||
#include "qwaylandlayersurface_p.h"
|
||||
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||
#include <QtWaylandClient/private/qwaylandsurface_p.h>
|
||||
#include <QtWaylandClient/private/qwaylandscreen_p.h>
|
||||
#include <QtWaylandClient/private/qwaylandsurface_p.h>
|
||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandClient::QWaylandWindow *window)
|
||||
: QtWaylandClient::QWaylandShellSurface(window)
|
||||
, QtWayland::zwlr_layer_surface_v1(
|
||||
// TODO: Specify namespace
|
||||
shell->get_layer_surface(window->waylandSurface()->object(),
|
||||
window->waylandScreen()->output(),
|
||||
QtWayland::zwlr_layer_shell_v1::layer_top,
|
||||
QStringLiteral("qt")))
|
||||
// TODO: Specify namespace
|
||||
shell->get_layer_surface(window->waylandSurface()->object(),
|
||||
window->waylandScreen()->output(),
|
||||
QtWayland::zwlr_layer_shell_v1::layer_top,
|
||||
QStringLiteral("qt")))
|
||||
{
|
||||
set_anchor(anchor_top | anchor_bottom | anchor_left | anchor_right);
|
||||
}
|
||||
|
@ -37,8 +37,7 @@ void QWaylandLayerSurface::zwlr_layer_surface_v1_closed()
|
|||
window()->window()->close();
|
||||
}
|
||||
|
||||
void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial,
|
||||
uint32_t width, uint32_t height)
|
||||
void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height)
|
||||
{
|
||||
ack_configure(serial);
|
||||
m_pendingSize = QSize(width, height);
|
||||
|
|
|
@ -10,24 +10,23 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||
#include "layershellqt_export.h"
|
||||
#include <QtWaylandClient/private/qwaylandshellsurface_p.h>
|
||||
#include <qwayland-wlr-layer-shell-unstable-v1.h>
|
||||
|
||||
namespace LayerShellQt {
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
class QWaylandLayerShell;
|
||||
|
||||
class LAYERSHELLQT_EXPORT QWaylandLayerSurface : public QtWaylandClient::QWaylandShellSurface,
|
||||
public QtWayland::zwlr_layer_surface_v1
|
||||
class LAYERSHELLQT_EXPORT QWaylandLayerSurface : public QtWaylandClient::QWaylandShellSurface, public QtWayland::zwlr_layer_surface_v1
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QWaylandLayerSurface(QWaylandLayerShell *shell,
|
||||
QtWaylandClient::QWaylandWindow *window);
|
||||
QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandClient::QWaylandWindow *window);
|
||||
virtual ~QWaylandLayerSurface();
|
||||
|
||||
bool isExposed() const override {
|
||||
bool isExposed() const override
|
||||
{
|
||||
return m_configured;
|
||||
}
|
||||
|
||||
|
@ -39,8 +38,7 @@ public:
|
|||
void applyConfigure() override;
|
||||
|
||||
private:
|
||||
void zwlr_layer_surface_v1_configure(uint32_t serial,
|
||||
uint32_t width, uint32_t height) override;
|
||||
void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override;
|
||||
void zwlr_layer_surface_v1_closed() override;
|
||||
|
||||
QSize m_pendingSize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue