mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-04 19:04:56 +11:00
wayland/idle-inhibit: fix formatting + lints, destructor, add logs
This commit is contained in:
parent
2c2983462c
commit
b8fa424f85
4 changed files with 40 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue