forked from quickshell/quickshell
hyprland/ipc: expose active and focused properties + activate()
This commit is contained in:
parent
207e6114a3
commit
62ccab5d30
7 changed files with 92 additions and 33 deletions
|
|
@ -7,8 +7,10 @@
|
|||
#include <qhash.h>
|
||||
#include <qlocalsocket.h>
|
||||
#include <qobject.h>
|
||||
#include <qproperty.h>
|
||||
#include <qqmlintegration.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
|
||||
#include "../../../core/model.hpp"
|
||||
#include "../../../core/qmlscreen.hpp"
|
||||
|
|
@ -74,7 +76,11 @@ public:
|
|||
void dispatch(const QString& request);
|
||||
|
||||
[[nodiscard]] HyprlandMonitor* monitorFor(QuickshellScreenInfo* screen);
|
||||
[[nodiscard]] HyprlandMonitor* focusedMonitor() const;
|
||||
|
||||
[[nodiscard]] QBindable<HyprlandMonitor*> bindableFocusedMonitor() const {
|
||||
return &this->bFocusedMonitor;
|
||||
}
|
||||
|
||||
void setFocusedMonitor(HyprlandMonitor* monitor);
|
||||
|
||||
[[nodiscard]] ObjectModel<HyprlandMonitor>* monitors();
|
||||
|
|
@ -119,10 +125,15 @@ private:
|
|||
|
||||
ObjectModel<HyprlandMonitor> mMonitors {this};
|
||||
ObjectModel<HyprlandWorkspace> mWorkspaces {this};
|
||||
HyprlandMonitor* mFocusedMonitor = nullptr;
|
||||
//HyprlandWorkspace* activeWorkspace = nullptr;
|
||||
|
||||
HyprlandIpcEvent event {this};
|
||||
|
||||
Q_OBJECT_BINDABLE_PROPERTY(
|
||||
HyprlandIpc,
|
||||
HyprlandMonitor*,
|
||||
bFocusedMonitor,
|
||||
&HyprlandIpc::focusedMonitorChanged
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace qs::hyprland::ipc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue