wayland/idle-inhibit: fix formatting + lints, destructor, add logs

This commit is contained in:
outfoxxed 2025-09-04 02:51:50 -07:00
parent 2c2983462c
commit b8fa424f85
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
4 changed files with 40 additions and 2 deletions

View file

@ -1,10 +1,18 @@
#include "proto.hpp"
#include <private/qwaylandwindow_p.h>
#include <qlogging.h>
#include <qloggingcategory.h>
#include <qwaylandclientextension.h>
#include "../../core/logcat.hpp"
namespace qs::wayland::idle_inhibit::impl {
namespace {
QS_LOGGING_CATEGORY(logIdleInhibit, "quickshell.wayland.idle_inhibit", QtWarningMsg);
}
IdleInhibitManager::IdleInhibitManager(): QWaylandClientExtensionTemplate(1) { this->initialize(); }
IdleInhibitManager* IdleInhibitManager::instance() {
@ -13,10 +21,13 @@ IdleInhibitManager* IdleInhibitManager::instance() {
}
IdleInhibitor* IdleInhibitManager::createIdleInhibitor(QtWaylandClient::QWaylandWindow* surface) {
return new IdleInhibitor(this->create_inhibitor(surface->surface()));
auto* inhibitor = new IdleInhibitor(this->create_inhibitor(surface->surface()));
qCDebug(logIdleInhibit) << "Created inhibitor" << inhibitor;
return inhibitor;
}
IdleInhibitor::~IdleInhibitor() {
qCDebug(logIdleInhibit) << "Destroyed inhibitor" << this;
if (this->isInitialized()) this->destroy();
}