hyprland/ipc: further cleanup + add Hyprland.focusedWorkspace

This commit is contained in:
outfoxxed 2025-03-27 00:25:21 -07:00
parent 67b2682604
commit 392f56c40e
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 39 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#include "qml.hpp"
#include <qobject.h>
#include <qproperty.h>
#include "../../../core/model.hpp"
#include "../../../core/qmlscreen.hpp"
@ -13,6 +14,14 @@ HyprlandIpcQml::HyprlandIpcQml() {
auto* instance = HyprlandIpc::instance();
QObject::connect(instance, &HyprlandIpc::rawEvent, this, &HyprlandIpcQml::rawEvent);
QObject::connect(
instance,
&HyprlandIpc::focusedMonitorChanged,
this,
&HyprlandIpcQml::focusedMonitorChanged
);
QObject::connect(
instance,
&HyprlandIpc::focusedMonitorChanged,
@ -30,15 +39,16 @@ HyprlandMonitor* HyprlandIpcQml::monitorFor(QuickshellScreenInfo* screen) {
}
void HyprlandIpcQml::refreshMonitors() { HyprlandIpc::instance()->refreshMonitors(false); }
void HyprlandIpcQml::refreshWorkspaces() { HyprlandIpc::instance()->refreshWorkspaces(false); }
QString HyprlandIpcQml::requestSocketPath() { return HyprlandIpc::instance()->requestSocketPath(); }
QString HyprlandIpcQml::eventSocketPath() { return HyprlandIpc::instance()->eventSocketPath(); }
HyprlandMonitor* HyprlandIpcQml::focusedMonitor() {
return HyprlandIpc::instance()->bindableFocusedMonitor().value();
QBindable<HyprlandMonitor*> HyprlandIpcQml::bindableFocusedMonitor() {
return HyprlandIpc::instance()->bindableFocusedMonitor();
}
QBindable<HyprlandWorkspace*> HyprlandIpcQml::bindableFocusedWorkspace() {
return HyprlandIpc::instance()->bindableFocusedWorkspace();
}
ObjectModel<HyprlandMonitor>* HyprlandIpcQml::monitors() {