@@ -37,6 +37,12 @@ class HyprlandToplevel: public QObject {
37
37
Q_PROPERTY (bool activated READ default NOTIFY activatedChanged BINDABLE bindableActivated);
38
38
// / Whether the client is urgent or not
39
39
Q_PROPERTY (bool urgent READ default NOTIFY urgentChanged BINDABLE bindableUrgent);
40
+ // / Last json returned for this toplevel, as a javascript object.
41
+ // /
42
+ // / > [!WARNING] This is *not* updated unless the toplevel object is fetched again from
43
+ // / > Hyprland. If you need a value that is subject to change and does not have a dedicated
44
+ // / > property, run @@Hyprland.refreshToplevels() and wait for this property to update.
45
+ Q_PROPERTY (QVariantMap lastIpcObject READ default BINDABLE bindableLastIpcObject NOTIFY lastIpcObjectChanged);
40
46
// / The current workspace of the toplevel (might be null)
41
47
Q_PROPERTY (qs::hyprland::ipc::HyprlandWorkspace* workspace READ default NOTIFY workspaceChanged BINDABLE bindableWorkspace);
42
48
// / The current monitor of the toplevel (might be null)
@@ -71,6 +77,10 @@ class HyprlandToplevel: public QObject {
71
77
[[nodiscard]] QBindable<bool > bindableActivated () { return &this ->bActivated ; }
72
78
[[nodiscard]] QBindable<bool > bindableUrgent () { return &this ->bUrgent ; }
73
79
80
+ [[nodiscard]] QBindable<QVariantMap> bindableLastIpcObject () const {
81
+ return &this ->bLastIpcObject ;
82
+ };
83
+
74
84
[[nodiscard]] QBindable<HyprlandWorkspace*> bindableWorkspace () { return &this ->bWorkspace ; }
75
85
void setWorkspace (HyprlandWorkspace* workspace);
76
86
@@ -86,6 +96,7 @@ class HyprlandToplevel: public QObject {
86
96
void urgentChanged ();
87
97
void workspaceChanged ();
88
98
void monitorChanged ();
99
+ void lastIpcObjectChanged ();
89
100
90
101
private slots:
91
102
void onActivatedChanged ();
@@ -103,6 +114,7 @@ private slots:
103
114
Q_OBJECT_BINDABLE_PROPERTY (HyprlandToplevel, bool , bUrgent, &HyprlandToplevel::urgentChanged);
104
115
Q_OBJECT_BINDABLE_PROPERTY (HyprlandToplevel, HyprlandWorkspace*, bWorkspace, &HyprlandToplevel::workspaceChanged);
105
116
Q_OBJECT_BINDABLE_PROPERTY (HyprlandToplevel, HyprlandMonitor*, bMonitor, &HyprlandToplevel::monitorChanged);
117
+ Q_OBJECT_BINDABLE_PROPERTY (HyprlandToplevel, QVariantMap, bLastIpcObject, &HyprlandToplevel::lastIpcObjectChanged);
106
118
// clang-format on
107
119
};
108
120
0 commit comments