forked from quickshell/quickshell
chore: clean up lints
This commit is contained in:
parent
4eac0b40c3
commit
cbdfba1a3f
13 changed files with 32 additions and 52 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "lock.hpp"
|
||||
|
||||
#include <private/qwaylandshellintegration_p.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <wayland-ext-session-lock-v1-client-protocol.h>
|
||||
|
||||
#include "manager.hpp"
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "manager.hpp"
|
||||
|
||||
#include <qdebug.h>
|
||||
#include <qlogging.h>
|
||||
#include <qwaylandclientextension.h>
|
||||
|
||||
#include "lock.hpp"
|
||||
|
|
|
@ -10,8 +10,9 @@
|
|||
#include "shell_integration.hpp"
|
||||
#include "surface.hpp"
|
||||
|
||||
static QSWaylandSessionLockManager* manager() {
|
||||
static QSWaylandSessionLockManager* manager = nullptr;
|
||||
namespace {
|
||||
QSWaylandSessionLockManager* manager() {
|
||||
static QSWaylandSessionLockManager* manager = nullptr; // NOLINT
|
||||
|
||||
if (manager == nullptr) {
|
||||
manager = new QSWaylandSessionLockManager();
|
||||
|
@ -19,6 +20,7 @@ static QSWaylandSessionLockManager* manager() {
|
|||
|
||||
return manager;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
bool SessionLockManager::lock() {
|
||||
if (this->isLocked() || SessionLockManager::sessionLocked()) return false;
|
||||
|
@ -79,7 +81,7 @@ bool LockWindowExtension::attach(QWindow* window, SessionLockManager* manager) {
|
|||
return false;
|
||||
}
|
||||
|
||||
static QSWaylandSessionLockIntegration* lockIntegration = nullptr;
|
||||
static QSWaylandSessionLockIntegration* lockIntegration = nullptr; // NOLINT
|
||||
if (lockIntegration == nullptr) {
|
||||
lockIntegration = new QSWaylandSessionLockIntegration();
|
||||
if (!lockIntegration->initialize(waylandWindow->display())) {
|
||||
|
@ -105,6 +107,6 @@ bool LockWindowExtension::attach(QWindow* window, SessionLockManager* manager) {
|
|||
}
|
||||
|
||||
void LockWindowExtension::setVisible() {
|
||||
if (this->surface == nullptr) immediatelyVisible = true;
|
||||
if (this->surface == nullptr) this->immediatelyVisible = true;
|
||||
else this->surface->setVisible();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ class SessionLockManager: public QObject {
|
|||
|
||||
public:
|
||||
explicit SessionLockManager(QObject* parent = nullptr): QObject(parent) {}
|
||||
Q_DISABLE_COPY_MOVE(SessionLockManager);
|
||||
|
||||
// Returns true if a lock was acquired.
|
||||
// If true is returned the caller must watch the global screen list and create/destroy
|
||||
|
@ -59,6 +58,7 @@ class LockWindowExtension: public QObject {
|
|||
public:
|
||||
explicit LockWindowExtension(QObject* parent = nullptr): QObject(parent) {}
|
||||
~LockWindowExtension() override;
|
||||
Q_DISABLE_COPY_MOVE(LockWindowExtension);
|
||||
|
||||
// Attach this lock extension to the given window.
|
||||
// The extension is reparented to the window and replaces any existing lock extension.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <private/qwaylandwindow_p.h>
|
||||
#include <qlogging.h>
|
||||
#include <qobject.h>
|
||||
#include <wayland-client-protocol.h>
|
||||
#include <qtypes.h>
|
||||
|
||||
#include "lock.hpp"
|
||||
#include "session_lock.hpp"
|
||||
|
@ -27,7 +27,7 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
|
|||
throw nullptr;
|
||||
}
|
||||
|
||||
wl_output* output = nullptr;
|
||||
wl_output* output = nullptr; // NOLINT (include)
|
||||
auto* waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen*>(qwindow->screen()->handle());
|
||||
|
||||
if (waylandScreen != nullptr) {
|
||||
|
@ -75,7 +75,7 @@ void QSWaylandSessionLockSurface::setExtension(LockWindowExtension* ext) {
|
|||
}
|
||||
|
||||
void QSWaylandSessionLockSurface::setVisible() {
|
||||
if (this->configured && !this->visible) initVisible();
|
||||
if (this->configured && !this->visible) this->initVisible();
|
||||
this->visible = true;
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ void QSWaylandSessionLockSurface::ext_session_lock_surface_v1_configure(
|
|||
|
||||
this->window()->resizeFromApplyConfigure(this->size);
|
||||
this->window()->handleExpose(QRect(QPoint(), this->size));
|
||||
if (this->visible) initVisible();
|
||||
if (this->visible) this->initVisible();
|
||||
} else {
|
||||
this->window()->applyConfigureWhenPossible();
|
||||
}
|
||||
|
@ -105,10 +105,10 @@ void QSWaylandSessionLockSurface::initVisible() {
|
|||
// We attach a dummy buffer to satisfy ext_session_lock_v1.
|
||||
this->initBuf = new QtWaylandClient::QWaylandShmBuffer(
|
||||
this->window()->display(),
|
||||
size,
|
||||
this->size,
|
||||
QImage::Format_ARGB32
|
||||
);
|
||||
|
||||
this->window()->waylandSurface()->attach(initBuf->buffer(), 0, 0);
|
||||
this->window()->waylandSurface()->attach(this->initBuf->buffer(), 0, 0);
|
||||
this->window()->window()->setVisible(true);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
void applyConfigure() override;
|
||||
bool handleExpose(const QRegion& region) override;
|
||||
|
||||
void setExtension(LockWindowExtension*);
|
||||
void setExtension(LockWindowExtension* ext);
|
||||
void setVisible();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue