mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
all: use MOC includes instead of opaque pointer defiinitions
Fixes linking issues and Qt 6.12 compatibility.
This commit is contained in:
1 parent
41651d7dcd
commit
5d5d49873f
16 files changed
+55
-40
No files matched your search
@@ -1,5 +1,6 @@
|
||||
## Other Changes
|
||||
|
||||
- Added support for Qt 6.12
|
||||
- Added support for Hyprland's new workspace address format.
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
@@ -8,18 +8,12 @@
|
||||
#include <qvector.h>
|
||||
|
||||
#include "node.hpp"
|
||||
#include "qml.hpp"
|
||||
|
||||
namespace qs::service::pipewire {
|
||||
|
||||
class PwNodeIface;
|
||||
class PwPeakStream;
|
||||
|
||||
} // namespace qs::service::pipewire
|
||||
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::service::pipewire::PwNodeIface*);
|
||||
|
||||
namespace qs::service::pipewire {
|
||||
|
||||
///! Monitors peak levels of an audio node.
|
||||
/// Tracks volume peaks for a node across all its channels.
|
||||
///
|
||||
|
||||
@@ -37,6 +37,18 @@ QS_LOGGING_CATEGORY(logHyprlandIpc, "quickshell.hyprland.ipc", QtWarningMsg);
|
||||
QS_LOGGING_CATEGORY(logHyprlandIpcEvents, "quickshell.hyprland.ipc.events", QtWarningMsg);
|
||||
} // namespace
|
||||
|
||||
QBindable<HyprlandMonitor*> HyprlandIpc::bindableFocusedMonitor() const {
|
||||
return &this->bFocusedMonitor;
|
||||
}
|
||||
|
||||
QBindable<HyprlandWorkspace*> HyprlandIpc::bindableFocusedWorkspace() const {
|
||||
return &this->bFocusedWorkspace;
|
||||
}
|
||||
|
||||
QBindable<HyprlandToplevel*> HyprlandIpc::bindableActiveToplevel() const {
|
||||
return &this->bActiveToplevel;
|
||||
}
|
||||
|
||||
HyprlandIpc::HyprlandIpc() {
|
||||
auto his = qEnvironmentVariable("HYPRLAND_INSTANCE_SIGNATURE");
|
||||
if (his.isEmpty()) {
|
||||
|
||||
@@ -25,9 +25,9 @@ class HyprlandToplevel;
|
||||
|
||||
} // namespace qs::hyprland::ipc
|
||||
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandWorkspace*);
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandMonitor*);
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandToplevel*);
|
||||
Q_MOC_INCLUDE("hyprland_toplevel.hpp")
|
||||
Q_MOC_INCLUDE("monitor.hpp")
|
||||
Q_MOC_INCLUDE("workspace.hpp")
|
||||
|
||||
namespace qs::hyprland::ipc {
|
||||
|
||||
@@ -83,17 +83,9 @@ public:
|
||||
|
||||
[[nodiscard]] QBindable<bool> bindableUsingLua() const { return &this->bUsingLua; }
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableFocusedMonitor() const {
|
||||
return &this->bFocusedMonitor;
|
||||
}
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableFocusedWorkspace() const {
|
||||
return &this->bFocusedWorkspace;
|
||||
}
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandToplevel*> bindableActiveToplevel() const {
|
||||
return &this->bActiveToplevel;
|
||||
}
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableFocusedMonitor() const;
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableFocusedWorkspace() const;
|
||||
[[nodiscard]] QBindable<HyprlandToplevel*> bindableActiveToplevel() const;
|
||||
|
||||
void setFocusedMonitor(HyprlandMonitor* monitor);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "../../toplevel/qml.hpp"
|
||||
#include "connection.hpp"
|
||||
#include "monitor.hpp"
|
||||
#include "toplevel_mapping.hpp"
|
||||
#include "workspace.hpp"
|
||||
|
||||
@@ -15,6 +16,10 @@ using namespace qs::wayland::toplevel;
|
||||
|
||||
namespace qs::hyprland::ipc {
|
||||
|
||||
QBindable<HyprlandWorkspace*> HyprlandToplevel::bindableWorkspace() { return &this->bWorkspace; }
|
||||
|
||||
QBindable<HyprlandMonitor*> HyprlandToplevel::bindableMonitor() { return &this->bMonitor; }
|
||||
|
||||
HyprlandToplevel::HyprlandToplevel(HyprlandIpc* ipc): QObject(ipc), ipc(ipc) {
|
||||
this->bMonitor.setBinding([this]() {
|
||||
return this->bWorkspace ? this->bWorkspace->bindableMonitor().value() : nullptr;
|
||||
|
||||
@@ -81,10 +81,10 @@ public:
|
||||
return &this->bLastIpcObject;
|
||||
};
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableWorkspace() { return &this->bWorkspace; }
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableWorkspace();
|
||||
void setWorkspace(HyprlandWorkspace* workspace);
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableMonitor() { return &this->bMonitor; }
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableMonitor();
|
||||
|
||||
signals:
|
||||
void addressChanged();
|
||||
|
||||
@@ -13,6 +13,10 @@ namespace qs::hyprland::ipc {
|
||||
|
||||
QVariantMap HyprlandMonitor::lastIpcObject() const { return this->mLastIpcObject; }
|
||||
|
||||
QBindable<HyprlandWorkspace*> HyprlandMonitor::bindableActiveWorkspace() const {
|
||||
return &this->bActiveWorkspace;
|
||||
}
|
||||
|
||||
void HyprlandMonitor::updateInitial(qint32 id, const QString& name, const QString& description) {
|
||||
Qt::beginPropertyUpdateGroup();
|
||||
this->bId = id;
|
||||
|
||||
@@ -54,9 +54,7 @@ public:
|
||||
[[nodiscard]] QBindable<qint32> bindableHeight() { return &this->bHeight; }
|
||||
[[nodiscard]] QBindable<qreal> bindableScale() { return &this->bScale; }
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableActiveWorkspace() const {
|
||||
return &this->bActiveWorkspace;
|
||||
}
|
||||
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableActiveWorkspace() const;
|
||||
|
||||
[[nodiscard]] QBindable<bool> bindableFocused() const { return &this->bFocused; }
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace qs::hyprland::ipc {
|
||||
|
||||
QVariantMap HyprlandWorkspace::lastIpcObject() const { return this->mLastIpcObject; }
|
||||
|
||||
QBindable<HyprlandMonitor*> HyprlandWorkspace::bindableMonitor() { return &this->bMonitor; }
|
||||
|
||||
HyprlandWorkspace::HyprlandWorkspace(HyprlandIpc* ipc): QObject(ipc), ipc(ipc) {
|
||||
Qt::beginPropertyUpdateGroup();
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
||||
[[nodiscard]] QBindable<bool> bindableUrgent() { return &this->bUrgent; }
|
||||
[[nodiscard]] QBindable<bool> bindableHasFullscreen() { return &this->bHasFullscreen; }
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableMonitor() { return &this->bMonitor; }
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableMonitor();
|
||||
[[nodiscard]] ObjectModel<HyprlandToplevel>* toplevels() { return &this->mToplevels; }
|
||||
|
||||
[[nodiscard]] QVariantMap lastIpcObject() const;
|
||||
|
||||
@@ -31,6 +31,14 @@ QS_LOGGING_CATEGORY(logI3Ipc, "quickshell.I3.ipc", QtWarningMsg);
|
||||
QS_LOGGING_CATEGORY(logI3IpcEvents, "quickshell.I3.ipc.events", QtWarningMsg);
|
||||
} // namespace
|
||||
|
||||
QBindable<I3Monitor*> I3IpcController::bindableFocusedMonitor() const {
|
||||
return &this->bFocusedMonitor;
|
||||
}
|
||||
|
||||
QBindable<I3Workspace*> I3IpcController::bindableFocusedWorkspace() const {
|
||||
return &this->bFocusedWorkspace;
|
||||
}
|
||||
|
||||
I3IpcController::I3IpcController(): I3Ipc({"workspace", "output"}) {
|
||||
// bind focused workspace to focused monitor's active workspace
|
||||
this->bFocusedWorkspace.setBinding([this]() -> I3Workspace* {
|
||||
|
||||
@@ -20,8 +20,8 @@ class I3Workspace;
|
||||
class I3Monitor;
|
||||
} // namespace qs::i3::ipc
|
||||
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::i3::ipc::I3Workspace*);
|
||||
Q_DECLARE_OPAQUE_POINTER(qs::i3::ipc::I3Monitor*);
|
||||
Q_MOC_INCLUDE("monitor.hpp")
|
||||
Q_MOC_INCLUDE("workspace.hpp")
|
||||
|
||||
namespace qs::i3::ipc {
|
||||
|
||||
@@ -43,13 +43,8 @@ public:
|
||||
|
||||
I3Monitor* monitorFor(QuickshellScreenInfo* screen);
|
||||
|
||||
[[nodiscard]] QBindable<I3Monitor*> bindableFocusedMonitor() const {
|
||||
return &this->bFocusedMonitor;
|
||||
};
|
||||
|
||||
[[nodiscard]] QBindable<I3Workspace*> bindableFocusedWorkspace() const {
|
||||
return &this->bFocusedWorkspace;
|
||||
};
|
||||
[[nodiscard]] QBindable<I3Monitor*> bindableFocusedMonitor() const;
|
||||
[[nodiscard]] QBindable<I3Workspace*> bindableFocusedWorkspace() const;
|
||||
|
||||
[[nodiscard]] ObjectModel<I3Monitor>* monitors();
|
||||
[[nodiscard]] ObjectModel<I3Workspace>* workspaces();
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
namespace qs::i3::ipc {
|
||||
|
||||
QBindable<I3Workspace*> I3Monitor::bindableActiveWorkspace() const {
|
||||
return &this->bActiveWorkspace;
|
||||
}
|
||||
|
||||
I3Monitor::I3Monitor(I3IpcController* ipc): QObject(ipc), ipc(ipc) {
|
||||
// clang-format off
|
||||
this->bFocused.setBinding([this]() { return this->ipc->bindableFocusedMonitor().value() == this; });
|
||||
|
||||
@@ -55,9 +55,7 @@ public:
|
||||
[[nodiscard]] QBindable<qreal> bindableScale() { return &this->bScale; }
|
||||
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
||||
|
||||
[[nodiscard]] QBindable<I3Workspace*> bindableActiveWorkspace() const {
|
||||
return &this->bActiveWorkspace;
|
||||
}
|
||||
[[nodiscard]] QBindable<I3Workspace*> bindableActiveWorkspace() const;
|
||||
|
||||
[[nodiscard]] QVariantMap lastIpcObject() const;
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
namespace qs::i3::ipc {
|
||||
|
||||
QBindable<I3Monitor*> I3Workspace::bindableMonitor() const { return &this->bMonitor; }
|
||||
|
||||
I3Workspace::I3Workspace(I3IpcController* ipc): QObject(ipc), ipc(ipc) {
|
||||
Qt::beginPropertyUpdateGroup();
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
[[nodiscard]] QBindable<bool> bindableActive() { return &this->bActive; }
|
||||
[[nodiscard]] QBindable<bool> bindableFocused() { return &this->bFocused; }
|
||||
[[nodiscard]] QBindable<bool> bindableUrgent() { return &this->bUrgent; }
|
||||
[[nodiscard]] QBindable<I3Monitor*> bindableMonitor() const { return &this->bMonitor; }
|
||||
[[nodiscard]] QBindable<I3Monitor*> bindableMonitor() const;
|
||||
[[nodiscard]] QVariantMap lastIpcObject() const;
|
||||
|
||||
void updateFromObject(const QVariantMap& obj);
|
||||
|
||||
Reference in new issue
Block a user